auto
2014-03-08 21:12
281 查看
• auto is used to infer the type of the variable that is being declared and initialized
• In ‘old’ C++:
• In C++ 11:
• Anyway,there are restrictions on its usage:
• You cannot use auto as a type of an argument of a function or method.
• Your method return type cannot be auto
• You cannot use auto to declare and initialize variables of several types in the same line, like this:
autox = 2, b = true, c = "hello"; //invalid auto usage
• In ‘old’ C++:
• In C++ 11:
• Anyway,there are restrictions on its usage:
• You cannot use auto as a type of an argument of a function or method.
• Your method return type cannot be auto
• You cannot use auto to declare and initialize variables of several types in the same line, like this:
autox = 2, b = true, c = "hello"; //invalid auto usage
相关文章推荐
- Auto Autorun.inf desktop.ini sxs.exe auto.exe类病毒的手动处理完全技巧
- auto病毒引发木马下载者病毒的完美解决方案[原创]
- CSS的inherit与auto使用分析
- How to Auto Include a Javascript File
- Mysql auto_increment 重新计数(让id从1开始)
- C语言关键字auto与register的深入理解
- 在MongoDB中模拟Auto Increment的php代码
- 在 Qt4 中使用 C++11
- C++爱好者博客
- C语言中auto,register,static,const,volatile的区别
- c语言的一些回顾------关键字之存储类别描述符
- vim c/c++智能补全插件
- 浅析构造函数之默认构造函数
- C++11之“move”语意
- C++11之Lambda表达式
- C++11特性乱弹
- 掀起C++ 11的神秘面纱(1)
- 掀起C++ 11的神秘面纱(2)
- Enable C++11 in gcc
- 用C++11 thread 类编写多线程程序