我执行这样的命令GCC,在命令行中有&&的含义是什么?
echo 'int main(){printf("%lu\n",sizeof(void));}' | gcc -xc -w -&& ./a.out
,并可以得到结果:1。 但我无法找出什么 - & &手段,甚至在搜索手册页和谷歌。而我尽量不执行它 - & & option.it将错误这样的:
./a.out:1: error: stray ‘\317’ in program
./a.out:1: error: stray ‘\372’ in program
./a.out:1: error: stray ‘\355’ in program
./a.out:1: error: stray ‘\376’ in program
./a.out:1: error: stray ‘\7’ in program
./a.out:1: error: stray ‘\1’ in program
./a.out:1: error: stray ‘\3’ in program
./a.out:1: error: stray ‘\200’ in program
./a.out:1: error: stray ‘\2’ in program
./a.out:1: error: stray ‘\16’ in program
./a.out:1: error: expected identifier or ‘(’ before numeric constant
./a.out:1: error: stray ‘\6’ in program
./a.out:1: error: stray ‘\205’ in program
./a.out:1: error: stray ‘\31’ in program
./a.out:1: error: stray ‘\1’ in program
./a.out:1: error: stray ‘\31’ in program
./a.out:1: error: stray ‘\2’ in program
......
谁知道选项的意思?
关于你的代码的一些注释:'sizeof(void)'是非标准的;由于gcc特定的扩展,它会产生1。打印'size_t'值的正确格式是'%zu'。在调用'printf'之前你需要'#include' - 这意味着你需要回显两行。 –