写了个简单的函数,编译竟然报错“main.c:9:38: error: stray”:
FILE* fp_out = fopen("file_out.mpg",“w+”);
~/tmp/testC/Test1$ gcc main.c -Wl,-Map,empty.map -o Empty
main.c: In function 鈥[01mmain鈥
main.c:9:38: error: stray 鈥[01m\342鈥in program
FILE* fp_out = fopen("file_out.mpg",[m€渨+鈥;
^
main.c:9:39: error: stray 鈥[01m\200鈥in program
FILE* fp_out = fopen("file_out.mpg",[01;31m€渨+鈥;
^
main.c:9:40: error: stray 鈥[01m\234鈥in program
FILE* fp_out = fopen("file_out.mpg",鈥[mw+鈥;
^
main.c:9:41: error: 鈥[01mw鈥undeclared (first use in this function)
FILE* fp_out = fopen("file_out.mpg",鈥[01;31mw+鈥;
^
main.c:9:41: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:43: error: stray 鈥[01m\342鈥in program
FILE* fp_out = fopen("file_out.mpg",鈥渨+[m€;
^
main.c:9:44: error: stray 鈥[01m\200鈥in program
FILE* fp_out = fopen("file_out.mpg",鈥渨+[01;31m€;
^
main.c:9:45: error: stray 鈥[01m\235鈥in program
FILE* fp_out = fopen("file_out.mpg",鈥渨+鈥[m);
^
main.c:9:46: error: expected expression before 鈥[01m)鈥token
FILE* fp_out = fopen("file_out.mpg",鈥渨+鈥[01;31m);
原因是,双引号使用成中文了。
FILE* fp_out = fopen("file_out.mpg",“w+”);
改成英文双引号后,编译OK
FILE* fp_out = fopen("abuf_apu_nbsm_o1_1_00720_out.mpg","w+");