hello world c++

来源:百度知道 编辑:UC知道 时间:2024/05/21 22:11:46
刚看了一点..不是很明白
//build the second and fouth lines of output
const std::string spaces(great.size(), ' ');
const std::string second="*" +spaces+"*";
//build the first and fifth lines of output
const std:string first (second.size () +' ')
这里为什么有5行.而不是6行7行?
另外为什么
变量GREETING 的类型 是STD::STRING 在运行过程中 求值呢?
//write all
std::cout << std ::end1; 这句话在这有什么用?

汗,,貌似刚才看见过..

为什么有5行.而不是6行7行?

那看编这程序的人想做什么了,想输出几行都可以,
你也可以自己改改代码让它输出多几行的

std::cout << std ::end1; 这句话在这有什么用?

换行(回车),并冲洗缓冲区
对于初学者,把它看作换行就可以了

不懂,来学习