error: stray ‘\240’ in program
container_of.c:17:1: error: stray ‘\240’ in program
container_of.c:17:1: error: stray ‘\302’ in program
container_of.c:17:1: error: stray ‘\240’ in program
container_of.c:17:1: error: stray ‘\302’ in program
container_of.c:17:1: error: stray ‘\240’ in program
container_of.c:17:1: error: stray ‘\302’ in program
container_of.c:17:1: error: stray ‘\240’ in program
container_of.c:17:1: error: stray ‘\302’ in program
container_of.c:17:1: error: stray ‘\240’ in program
container_of.c:18:1: error: stray ‘\302’ in program
代码编译时出现错误, 原因是代码是网页上copy过来的, 很可能包含中文字符以及其他字符。
解决办法是: 删除非法ascii码字符
软件: notepad++
操作步骤
- ctrl+f 调出查找窗口
- 勾选
查找模式
下的正则表达式- 正则表达式
- 输入
[^\x00-\x7F]+
- 替换为空格