C++关键字总结explict/auto/decltype/typedef等
2016-12-07 19:37
218 查看
explict
用法:定义在构造函数中,不允许隐式的类型转换。auto/decltype
typedef
typedef的用法,这篇文章总结的比较好:C/C++ typedef用法
总结来说就是,可以把typedef看成类似于宏#define的东西,把所有typedef替换成之前typedef的内容,同时把后面的东西替换成typedef
如:
typedef char Line[81]; Line text; //Line text就等同于把 char Line[81]替换到这个位置,然后再把Line换成text,所以等于char text[81] typedef void (*PrintHelloHandle)(int); PrintHelloHandle pFunc; //这里等于先换成void (*PrintHelloHandle)(int),然后再把PrintHelloHandle换成pFunc,所以就变成 //void (*pFunc)(int);
相关文章推荐
- auto和decltype的用法总结
- auto和decltype的用法总结以及主要区别
- (5)风色从零单排《C++ Primer》 const,typedef,auto,decltype
- C++ 学习笔记(2)变量和基本类型(复合类型:引用、指针)、const、constexpr、typedef(using)、auto、decltype
- c++ 关于decltype和auto的一点小总结
- 处理类型(typedef,uisng,auto,decltype)
- auto和decltype的用法总结
- typedef的用法及与define的区别总结[转]
- C++ typedef使用方法总结
- 关键字:auto、static、register、const、volatile 、extern 总结
- django的转义总结:escape,autoescape,safe,mark_safe
- typedef总结
- typedef的使用总结(转)
- django的转义总结:escape,autoescape,safe,mark_safe
- typedef总结
- 关于typedef的用法总结
- typedef的用法总结
- 关键字:auto、static、register、const、volatile 、extern 总结
- typedef用法总结之续
- 存储类说明符 auto register static extern typedef