15:20 2021/3/10
ifconfig 查看linux ip
ipconfig 查看windows ip
control shift +c复制
vim 编辑器
按 i或a进入插入模式 esc退出插入模式 shift zz退出 shift : 进入底行模式
shift :q 回车退出 shift : q!回车强制退出
在编辑器里 esc退出插入模式进入指令模式 yy复制行(10yy 十行 光标放在目标行前) p粘贴行 dd删除行 uu恢复行
shift:wq 退出并保存
底行模式下 s/hello/hi 将hello改为hi s/hello/hi/g 整行hello切换为hi
gcc hello.c -o hello 编译 ./运行
gcc编译器编译
1 预处理 (生成文件后缀.i) gcc -E hello.c -o hello.i vim hello.i
2 编译 :语法检查,将C程序编译成汇编语言 gcc -S hello.c -o hello.s
3汇编:把汇编代码翻译成二进制代码 (后缀.o)gcc -c hello.s -o hello.o
4链接 链接需要的代码或者c库 gcc hello.o -o hello
etc系统配置文件
条件编译(只输出1)
#define MAX 100
int mian()
{
int num=MAX;
#idndef MAX(#if 0)
printf(“1”);
#else
printf(“2”);
#endif
return 0;