C++复习之知识点

2017-03-24  本文已影响0人  冰鋒

1.编译

编译C++程序时,编译器自动定义一个__cplusplus。

编译标准C时,编译器自动定义__STDC__。

2.assert()通用宏定义

3. 动态内存

int * p = new int(20)   定义一个无名int,初始化为20   delete p

int * p = new int[20]   数组p      delete [] p

4.泛型(模板)

template  <class elemType>

调用的时候:直接传类型参数

上一篇 下一篇

猜你喜欢

热点阅读