这里主要是完成c++在ubuntu18.04下的编译:
首先需要编译器,这里我在直接用的ubuntu自带的g++
1.操作流程 在终端中:
gedit
2.save as xxxx.cpp
在文本中输入以下内容:
#include<iostream>
using namespace std;
int main()
{
cout<<"hello world!"<<endl;
return 0;
}
3.终端输入:
g++ -o hello main.cpp
4.输出:
./hello
同理写了一个:add.cpp
结果: