unsigned char flag=0;”和“unsigned char flag;flag=0;”没有区别有可能是你的flag=0写在函数外面导致出错。整段代码贴出来才好判断错误位置。
这个不清楚啊