编译错误:stray ‘\357’ in program的解决方法
如编译时遇到如下所示的编译错误:
./month_matcher.cpp:1: error: stray ‘\357’ in program
./month_matcher.cpp:1: error: stray ‘\273’ in program
./month_matcher.cpp:1: error: stray ‘\277’ in program
./month_matcher.cpp:1: error: stray ‘\357’ in program
./month_matcher.cpp:1: error: stray ‘\273’ in program
./month_matcher.cpp:1: error: stray ‘\277’ in program
则说明文件为“带BOM头的UTF8”编码格式,相应的解决方法是将文件转换为“不带BOM头的UTF8”编码格式,Notepad++就带有这样的功能: