我在98下编译可以通过,可是在2000下编译时提示这个错误,error C2001: newline in constant
有人知道是什么原因吗?

解决方案 »

  1.   

    编译器错误 C2001常数中有换行符字符串常数不能继续到第二行,除非进行下列操作: 用反斜杠结束第一行。 
    用一个双引号结束第一行上的字符串,并在下一行用另一个双引号开始该字符串。 
    用 \n 结束第一行是不够的。例如:printf("Hello,             // error
        world");
    printf("Hello,\n          //  error
        world");
    printf("Hello,\           //  OK
     world");
    printf("Hello,"            // OK
        " world");
    下一行开始处位于行继续符后的空格包含在字符串常数中。以上显示的示例都没有将换行符嵌入字符串常数中。可以按如下所示嵌入换行符:printf("Hello,\n\
    world");
    printf("Hello,\
    \nworld");
    printf("Hello,\n"
        "world");
    printf("Hello,"
     "\nworld");