char数组赋值的问题 c语言

来源:百度知道 编辑:UC知道 时间:2024/05/08 09:27:30
今天写了一个大小写转换的程序,.没有界面的时候编译通过.
现在我不想用\n\t之类的控制字符排版.所以定义字符数组如下:

char info[]="shift.exe -[up/down] [destination flie] [source file]
-up shift all lowercase in the source flie up to capital ,
the capital unchange.and output in destination file.
-down shift all capital in the source file down to lowercase.
the lowercase unchange.and output in destination file.
example:shift.exe -up lower.txt capital.txt
shift.exe -down capital.txt lower.txt";

但是编译器说字符串没有结束.(因为我换行了.在字符串结尾处有"和;)
记得以前看见过高手们这样做过了的.大家指点一下~~
所谓界面就是上面所示得那个char数组.

1.从第1行到第6行,每行末尾添加续行符'\'。
2.或者写成这样:
char *info[] = {"shift.exe ...[source file]",
"-up ... capital",
"the ... file.",
"-down ... lowercase.",
"the ... file.",
"example ... .txt",
"shift.exe ... .txt"};

支持 每行末尾添加续行符'\'。