helloworld
代码分析
//头文件,使用某个函数前,包含相应的头文件//**<>**通过包含系统的头文件(标准的头文件),**""**包含自定义的头文件#include //main函数int main(){//函数调用,往标准输出设备打印内容// 代表换行printf("hello c");//返回值return 0;} 编译
1、未指定输出文件会默认生成a.out
gcc 01_hello.c 
2、指定生成文件
gcc 01_hello.c -o 01_hello
运行
1、当前目录
./ 01_hello
2、绝对路径
/usr/local/c_study/c_code/day03/01_hello
注意
如果没有安装gcc 需要安装gcc
yum install gcc 代码
#include int main(){printf("hello c");return 0;} --------------------------------------------------------------------------------------------------------------
system()函数
#includeint system(const char *command);功能:在已经运行的程序中执行另外一个外部程序参数:外部可执行程序名字返回值:不同系统返回值不一样 例子
#include #includeint main(){printf("before sys--------");//在02_system程序中执行01_hello程序system("./01_hello");printf("after sys---------");} 运行结果

