您的位置:首页 > 运维架构 > Linux

Linux 编译运行 C/C++程序

2011-08-08 22:22 375 查看
终端输入命令

emacs

打开emacs编辑器。编写代码

#include <iostream>

using namespace std;

int main()

{

cout<<"hello world.."<<endl;

return 0;

}

保存为test.cpp

在终端敲击键盘ctr+Z进入终端命令行

输入命令行,进行编译(若是C语言,使用gcc代替g++)

g++ test.cpp -o testcpp

运行命令:

./testcpp

运行结果:

hello world..

可以使用emacs test.cpp进行对程序进行修改。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: