linux:cpp学习:cpp基本语法
cpp基本语法
1. 变量
1.1 auto变量
https://blog.csdn.net/weixin_43744293/article/details/117440727
// auto变量定义时,必须要初始化, 带了初始化值编译器就会自动推导出变量的实际type, 这样在一定程度上可减少定义的输入。 auto b = true; // a bool auto ch = 'x'; // a char auto i = 123; // an int auto d = 1.2; // a double auto z = sqrt(y); // z has the type of whatever sqr t(y) retur ns
linux/cpp学习/cpp基本语法.txt · 最后更改: 2023/03/17 10:12 由 127.0.0.1