Ubuntu 下 C++ 编程起步

1. 首先安装g++

  sudo apt-get install build-essential

2. 输入一个简单的cpp程序

#include <iostream>
using  namespace std;
int main()
{
    cout <<  " Hello Ubuntu! " << endl;
     return  0;
}

3. 编译

  david@ubuntu:~/MyTrain/CPlus$  g++ -o hello.exe hello.cpp

4. 运行

  david@ubuntu:~/MyTrain/CPlus$ ./hello.exe

5. 结果

  Hello Ubuntu!

 

转载于:https://www.cnblogs.com/davidgu/archive/2012/05/29/2523976.html

猜你喜欢

转载自blog.csdn.net/weixin_34402408/article/details/93802796