码迷,mamicode.com
首页 > 系统相关 > 详细

Linux之Hello World

时间:2015-05-04 19:59:22      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

 

1  Source code for hello.c

1 /* hello.c */
2 #include <stdlib.h>
3 #include <stdio.h>
4 
5 int main()
6 {
7   printf("Hello World!\n");
8   exit(0);
9 }

 

2  Compile, link and run

$ gcc -o hello hello.c
$ ./hello
Hello World!

 If you forget the -o name option that tells the compiler where to place the executable, it will place the program in a file called a.out (meaning assembler output). 

Linux之Hello World

标签:

原文地址:http://www.cnblogs.com/mengdie/p/4477026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!