摘要: #include <iostream> struct student { int a; int b; int add(){ //在结构体内封装了函数 return a+b; } }; int main(){ student s={10,20}; //c++时struct 可以省略 int x=s.a 阅读全文
posted @ 2020-07-29 21:12 天子骄龙 阅读(156) 评论(0) 推荐(0)
摘要: C++标准输入、输出 名字空间 结构体 VS2017安装C++ 命名空间 向量vector string类 c++字符串 窄字节宽字节 Cstring Ansi与Unicode 操作符别名 函数的重载 在C++中用C编译函数-extern "C" {} 函数的缺省参数 函数的哑元参数 内联函数 ne 阅读全文
posted @ 2020-07-29 18:34 天子骄龙 阅读(696) 评论(0) 推荐(0)
摘要: 预处理指令: #include <stdio.h> int main() { //条件编译 #if 0 printf("我是中国人\n") ; //不会被编译 #endif #if 1 printf("我喜欢中国\n") ; #endif #if 0 printf("wo\n") ; #elif 1 阅读全文
posted @ 2020-07-29 17:12 天子骄龙 阅读(152) 评论(0) 推荐(0)