#include<iostream>
using namespace std;
int main()
{
cout<<"Helllo World"<<endl;
return 0;
}
函数重载
函数模板:建立一个通用函数 template<typename T>
是相同类型数据的集合
指针
数组和指针
字符串和指针
函数和指针:函数指针,指向函数的指针
引用是一种变量类型,它用于一个变量起的别名
引用作为参数
常引用: int a;
a = 1;
const int &r = a;
struct 结构名{
.......
};
union 共用体类型名{
.....
}变量名;
枚举
enum 枚举类型名 {枚举常量列表};
enum weather {sunny,cloduy,rainly,windy};
1 宏定义
#define 宏名 字符串
#define 宏 (参数表列) 宏
2 文件包含
do...while(0) 的妙用
3 条件编译
#ifdef 标识符
程序段 1
#else
程序段 2
#endif
4 布局控制
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
__cplusplus是C++的预定义宏