c++运算符重载

作为成员函数重载 class Point { public: int x; int y; Point(int a = 0, int b = 0) : x(a), y(b) {} bool operator...

C++输出整数二进制

#include<iostream> #include<bitset> using namespace std;//必须得加上 int main() { int a=1000; cout<<"默认下"<<a&...

C++输入技巧

#include<bits/stdc++.h> using namespace std; int main(){ int a,b; //按ctrl+Z退出输入 while(cin>>a>>b){ cout<<...

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接口常用的两种方式