C++之helloworld

C++之helloworld

#include <iostream>  // 标准的输入输出流
using namespace std; // 命名空间 防止命名冲突

// main 函数
int main()
{
    // 标准输出
    // << 拼接功能
    // endl 结束换行
    cout << "hello world" << endl;
    system("pause");     // 阻塞功能
    return EXIT_SUCCESS; // 正常退出
}

** 编译命令 **

g++ xxx.cpp -o xxx // 编译xxx.cpp 文件为 xxx 可执行文件
start xxx.exe // 执行 xxx.exe 可执行文件
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章