C++常用占位符

%d, %i 代表整数(bool类型也可以用%d)%f 浮点(float类型)%lf 浮点(double类型)%s 字符串%c char%p 指针%fL 长log%e 科学计数%g 小数或科学计数%a,%A 读入一个浮点值(仅C99有效)%c 读入一个字符%d 读入十进制整数%i 读入十进制,...

C++之值传递&指针传递&引用传递详解

函数基础一个函数由以下四部分组成:返回类型函数名参数(0个或多个)函数体其中,函数的参数叫做形参,函数执行的操作的语句块叫做函数体值传递#include <iostream> void Swap(int a, int b) { int tmp = a; a = ...

C++ 中的gets函数哪里去了

C++ 中的gets函数哪里去了?为何编译报错?根据 https://zh.cppreference.com/w/cpp/io/c/gets , gets函数已经被移除。 可以使用#define gets(S) fgets(S,sizeof(S),stdin) 作为兼容性宏替换。示例1#inc...

C++ 不定参数...

#include<bits/stdc++.h> using namespace std; //count用于表明后续需要读入多少个参数 void sum(int count,...) { va_list v; va_start(v, count); ...

c++ stringstream常见用法

数据类型转换#include <string> #include <sstream> #include <iostream> #include <stdio.h> using namespace std; int main() { s...

c++ lambda表达式

[capture list] (parameters) -> return_type { // 函数体 };#include <iostream>include <vector>include <algorithm>struct Node...

C#请求WebApi接口常用的两种方式

C#请求WebApi接口常用的两种方式

C#控制台console

FluentConsole

C 库函数 - sprintf()格式化输出到 str 所指向的字符串

描述C 库函数 int sprintf(char str, const char format, ...) 发送格式化输出到 str 所指向的字符串。声明下面是 sprintf() 函数的声明。int sprintf(char str, const char format, ...)#incl...

break与continue

break与continue#include<bits/stdc++.h> using namespace std; int main(){ for(int i=1;i<=10;i++){ if(i==3)break;//i==3时跳出循环 ...