出错程序:
int
frame_input(int pid)
{
printf("<script language=/"JavaScript/">
function r1() {
出错信息:
bbsnewchat.c:88:16: missing terminating " character
解决方法:
编译安装ythtBBS时,常遇到这样的错误提示。因为编译器对字符串的处理方式不
同,所以会出现以上的错误。解决的方法,是在出错行的字符串结尾加上“(分号
)。
因为
一般语句里面换行写没问题 比如
printf("12345"
"67890/n"); //输出1234567890,注意这里5后面的"和6前面的"号,上面出错
程序就是犯了这样的错误。
又比如
printf("123"
"456"
"789"
"/n");
#define的话要写在一行里面,或者用/,比如
#define ABC "12345" /
"67890"
bbsnewchat.c:294:36: warning: character constant too long for its type
bbsnewchat.c:294: error: stray '/300' in program
bbsnewchat.c:294: error: stray '/353' in program
bbsnewchat.c:294: error: stray '/277' in program
bbsnewchat.c:294: error: stray '/252' in program
bbsnewchat.c:294: error: stray '/262' in program
bbsnewchat.c:294: error: stray '/350' in program
bbsnewchat.c:294: error: stray '/271' in program
bbsnewchat.c:294: error: stray '/335' in program
bbsnewchat.c:295:19: warning: character constant too long for its type
bbsnewchat.c:295: error: stray '/301' in program
bbsnewchat.c:295: error: stray '/304' in program
bbsnewchat.c:295: error: stray '/314' in program
bbsnewchat.c:295: error: stray '/354' in program
bbsnewchat.c:295: error: stray '/312' in program
bbsnewchat.c:295: error: stray '/322' in program
bbsnewchat.c:295: error: stray '/260' in program
bbsnewchat.c:295: error: stray '/357' in program
bbsnewchat.c:295: error: stray '/326' in program
bbsnewchat.c:295: error: stray '/372' in program
出错信息里的/***(比如/372)是汉字,出错的原因是因为gcc版本的处理方式,
301是汉字,有的编译器字符串可以跨多行,有的编译器不行。上面的出错就是因
为编译器的版本问题。解决的方法是,在每行的后面加上一个 /(表示换行) 就可
以了。
待续