hello world in Linux
2014-09-24 13:14
218 查看
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
保存文件为hello.c后,编译链接程序生成可执行文件。
方法1:gcc hello.c //生成可执行文件,默认名称为a.out
方法2:gcc hello.c -o hello //生成可执行文件hello
方法3:gcc -o hello hello.c //也可以调换一下位置
另外,linux下一半安装了若干c编译器,比如cc, c99, gcc。想知道关于编译器的信息,可以输入命令whatis cc查看。
stdio.h文件一般再linux下的/usr/include文件夹下面。
相关文章推荐
- opencv Installation in Linux and hello world
- hello world in Linux
- Linux Annoyances for Geeks : Getting the Most Flexible System in the World Just the Way You Want It
- List of Hello World Programs in 200 Programming Languages
- apache module helloworld, Linux平台使用C编写网页 CGI helloword 实例
- Compile my helloworld cpp program on Ubuntu linux
- linux java jni helloworld
- Linux设备驱动程序学习(0)-Hello, world!模块
- Linux 下 Makefile 的 automake 生成举例 "hello world"
- Notes [ Linux Device Drivers, 3rd Edition ( Ch02 ) - The Hello World Module ]
- linux2.6驱动编程第一例:hello,world的实现步骤
- (转)Linux下编写C程序( GCC )(hello,world)
- Hello World in GLSL glsl的第一个例子,Hello World
- Linux设备驱动程序学习(0)-Hello, world!模块
- Linux设备驱动程序学习(0)-Hello, world!模块
- just for fun in linux world
- Linux设备驱动程序学习(0)-Hello, world!模块
- linux gcc /n Hello world!
- iPhone起步-1: "Hello,World!" in iPhone Development
- linux下hello—world驱动,做成功了,现在总结一下