//预编译指令
#fileonce 该文件仅仅加载一次
#include 加载文件
#define 定义宏
#ifdefine 如果定义了宏
#ifndefine 如果没有定义宏
#endif 结束IF
//关键字-类型
typedef 转义类型
var 动态变量
int 整形
float 浮点数
double 双浮点
int64 64位整形
string 字符串UTF-8
wstring 宽字符UTF-16
new
//关键字-类相关
class 类
interface 接口
singleton 单键
signal 信号
slot 槽
emit 发消息
public 公有
protect 保护
private 私有
virtual 虚
emnu 枚举
//关键字-语法
return
break
continue
if
for
switch
case
default
static
//数据结构
set 集合
vector 向量
map 字典(std::map)
hash 哈希表
list 链表
//要实现的Demo
class CA {
public:
CA() {
printf("Init CA");
}
~CA() {
printf("UnInit CA");
}
public:
int add(int a, int b) {
return a+b;
}
static int gAdd(int a, int b) {
return a+b;
}
}
class CB : public CA{
virtual int add(int a, int b){
return a+b + 100000;
}
}
singleton class CC:public CB{
int a = 15;
int b = 20;
}
void main(){
int a = 50;
float b = 50.13f;
double c = 66.66;
var str = "Hello!";
var str2 = "World!"
var str3 = str + str2;
printf(::GetType(str));
CA cb = new CB();
int num = cb.add(5, 8);
printf("" + num);
num = CB.gAdd(10, 10);
printf("" + num);
CC cc = CC.singleton();
num = CB.gAdd(cc.a, cc.b);
}