Chinaunix首页 | 论坛 | 博客
  • 博客访问: 50573
  • 博文数量: 34
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 297
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-09 10:52
文章分类

全部博文(34)

文章存档

2015年(23)

2014年(11)

我的朋友

发布时间:2014-04-21 23:29:49

inline函数是C++引入的机制,目的是解决使用宏定义的一些缺点。1.为什么要引入内联函数(内联函数的作用)  用它替代宏定义,消除宏定义的缺点。宏定义使用预处理器实现,做一些简单的字符替换因此不能进行参数有效性的检测。另外它的返回值不能被强制转换为可转换的合适类型,且C++中引入了类及类的访.........【阅读全文】

阅读(827) | 评论(0) | 转发(1)

发布时间:2014-04-18 10:56:27

初始化和赋值 // constructing vectors #include <iostream>#include <vector> using namespace std; int main (){ unsigned int i; // constructors used in the same order as described above: vector<int> first; // empty vector of ints vector<int> second (4,100); // four ints with value 100.........【阅读全文】

阅读(688) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册