$ gcc hello.c -o hello
$ ./hello以上两行指令也可以合写为一行:
$ gcc hello.c -o hello && ./hello如果不写 -o 参数,编译后将自动生成名为 a.out 的可执行文件。
$ gcc hello.c
$ ./a.out$ g++ hello.cpp -o hello
$ ./hello如果不写 -o 参数,编译后将自动生成名为 a.out 的可执行文件。
$ g++ hello.cpp
$ ./a.out首先系统要安装有 clang-format,然后再给 VSCode 安装 clang-format 插件,插件安装好後,可以使用 Ctrl+Shift+I 执行格式化代码操作。