Linux VIM 程序中有游离的‘\357’ ‘\274’错误

gcc date.cpp -o date -lstdc++
date.cpp:18:20: 错误:程序中有游离的‘\357date.Showdata()���
                    ^
date.cpp:18:21: 错误:程序中有游离的‘\274date.Showdata()���
                     ^
date.cpp:18:22: 错误:程序中有游离的‘\233date.Showdata()���
                      ^
date.cpp: 在函数‘int main()’中:
date.cpp:19:1: 错误:expected ‘;’ before ‘}’ token
 }
 ^

调试方法
od -c date.cpp

0000000   #   i   n   c   l   u   d   e       <   i   o   s   t   r   e
0000020   a   m   >  \n   #   i   n   c   l   u   d   e       "   d   a
0000040   t   e   .   h   "  \n  \n   u   s   i   n   g       n   a   m
0000060   e   s   p   a   c   e       s   t   d   ;  \n  \n   i   n   t
0000100       m   a   i   n   (   )  \n   {  \n                   D   a
0000120   t   e       d   a   t   e   ;  \n                   /   / 350
0000140 260 203 347 224 250 345 207 275 346 225 260 346 211 223 345 215
0000160 260 347 232 204 346 226 271 346 263 225  \n                   d
0000200   a   t   e   .   S   e   t   d   a   t   a   (   2   0   0   0
0000220   ,   1   ,   1   )   ;  \n                   d   a   t   e   .
0000240   S   h   o   w   d   a   t   a   (   )   ;  \n                
0000260  \n                   d   a   t   e   .   S   e   t   D   a   y
0000300   (   2   )   ;  \n                   d   a   t   e   .   S   h
0000320   o   w   d   a   t   a   (   )   ;  \n                   d   a
0000340   t   e   .   S   e   t   Y   e   a   r   (   1   9   9   0   )
0000360   ;  \n                   d   a   t   e   .   S   h   o   w   d
0000400   a   t   a   (   )   ;  \n                   d   a   t   e   .
0000420   S   e   t   M   o   n   t   h   (   1   2   )   ;  \n        
0000440           d   a   t   e   .   S   h   o   w   d   a   t   a   (
0000460   ) 357 274 233  \n   }  \n  \n
0000470

错误出现在最后一行,删除即可。
错误原因:英文的;写成了中文的;

猜你喜欢

转载自blog.csdn.net/csdn_kou/article/details/81274495