
Ubuntu version is 14.04, with default g++ compiler.
Steps:
- 打开控制台,输入touch helloworld.c(pp),生成源代码文件。
- gedit helloworld.c(pp),使用gedit打开编辑源代码。
比如:
1
2
3
4
5
6
int (){
printf("hello world!n");
return 0;
}
OR
1 |
|
-
编辑完成后保存退出,在控制台输入
1
g++ helloworld.c(pp) -o helloworld
- 通过./helloworld运行编译链接好的程序。




近期评论