编码过程中字符串可能过长,这通常须要换行,对于换行转义字符\ ,使用时要保证\后无空格,否则会出现“error C2017:非法的转义字符 ”错误
如
// \'\'\"后无空格
string sql = "insert into table1 " \
+ " values (\'test\')";
string sql1 = "insert into table1 \
values (\'test2\')";
//上面两种写法都正确。
//以下两种写法会提示C2017错误
// \'\\'后有空格
string sql = "insert into table1 " \
+ " values (\'test\')";
string sql1 = "insert into table1 \
values (\'test2\')";