基本文件操作 常用头文件 #include<sys/types.h> #include<sys/stat.h> #include<unistd.h> //unix std #include<fcntl.h> //file control 常用函数 open() int open(const char *pathname, int flags, int perms); 所需头文件 #include<sys/types.h> #include<sys/s…
基本文件操作 常用头文件 #include<sys/types.h> #include<sys/stat.h> #include<unistd.h> //unix std #include<fcntl.h> //file control 常用函数 open() int open(const char *pathname, int flags, int perms); 所需头文件 #include<sys/types.h> #include<sys/s…
GCC编译 编译过程 预处理->编译->汇编->链接 预编译:去掉(替换)源文件中的以#开头的预处理指令; 编译:将源文件变成目标处理器格式的汇编语言文件; 汇编:将汇编语言文件变成目标处理器格式的二进制文件; 链接:将多个相关的目标文件组装成最后的可执行文件。 分步编译、链接 预处理(-E) gcc -E hello.c -o hello.i [-o outfile] 为输出到指定文件,-o hello.i即为输出到hello.i 编译(-S) gcc -S hello.i 等效于gcc -S hello.i -…