作者:互联网 时间: 2026-09-02 09:36:54
C语言——入门的重点在于把前置条件、操作顺序和容易误判的地方分清楚。
//头文件,使用某个函数前,包含相应的头文件//**<>**通过包含系统的头文件(标准的头文件),**""**包含自定义的头文件#include <stdio.h>//main函数int main(){//函数调用,往标准输出设备打印内容// 代表换行printf("hello c");//返回值return 0;}1、未指定输出文件会默认生成a.out
gcc 01_hello.c

2、指定生成文件
gcc 01_hello.c -o 01_hello

./ 01_hello

/usr/local/c_study/c_code/day03/01_hello

如果没有安装gcc 需要安装gcc
yum install gcc#include <stdio.h>int main(){printf("hello c");return 0;}--------------------------------------------------------------------------------------------------------------
#include<stdlib.h>int system(const char *command);功能:在已经运行的程序中执行另外一个外部程序参数:外部可执行程序名字返回值:不同系统返回值不一样#include <stdio.h>#include<stdlib.h>int main(){printf("before sys--------");//在02_system程序中执行01_hello程序system("./01_hello");printf("after sys---------");}运行结果
