美文网首页
一、C++基础

一、C++基础

作者: 盗花 | 来源:发表于2016-05-07 17:47 被阅读15次

1.endl
功能说明:endl的功能类似于换行符\n。特别需要说明的是,在CLion中调试代码时,若在一条语句的末尾,如cout << "hello world!" ;,加上\n或者<< endl,则单步调试完该行代码,就会在终端输出相应的语句,否则不会输出。
用法:使用endl,必须要在代码文件开头添加using namespace std;
示例:
#include <iostream>

using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    int a = 123;
    cout << "百二秦关终属楚,三千越甲可吞吴.\n";
    cout << "永岁飘零,殢无伤!";
    return 0;
}

相关文章

网友评论

      本文标题:一、C++基础

      本文链接:https://www.haomeiwen.com/subject/yofsrttx.html