c++第一天

1、熟悉cpp文件的编译运行


2、初步认识输入输出

值得关注的地方是: 流的概念。endl除了结束当前行外,还有刷新缓冲区的功能。以及对

输入输出运算符(<< 、>>)所构成的表达式(expression)的重新理解:运算结果就是左侧对象!(表达式的值)。

 

遇到的问题:

1、遇到的某一个编译错误:error: 'endln' is not a member of 'std' 

2、形如这样的程序是错误的

std::cout << "The sum of " << v1;
    << " and " << v2;
    << " is " << v1 + v2 << std::endln;

因为根本编译不出来

error: expected primary-expression before '<<' token

意思是表达式缺少前操作数(我猜的。。)

 

posted @ 2017-01-07 16:41  xkfx  阅读(340)  评论(0编辑  收藏  举报