我有一个很长的sqlite查询:
const char *sql_query = "SELECT statuses.word_id FROM lang1_words, statuses WHERE statuses.word_id = lang1_words.word_id ORDER BY lang1_words.word ASC";
Run Code Online (Sandbox Code Playgroud)
如何在多行中打破它以便于阅读?如果我执行以下操作:
const char *sql_query = "SELECT word_id
FROM table1, table2
WHERE table2.word_id = table1.word_id
ORDER BY table1.word ASC";
Run Code Online (Sandbox Code Playgroud)
我收到了一个错误.
有没有办法在多行中编写查询?
请采取以下措施:
char buffer[512];
memset(buffer, 0, sizeof(buffer));
sprintf(&buffer[0],"This Is The Longest String In the World that in text goes on and..");
printf("Buffer:%s\r\n",buffer);
Run Code Online (Sandbox Code Playgroud)
我希望能够在多行上创建此字符串,以便于故障排除和编辑.但是,当我使用\命令时,我的输出被看似是标签的东西分开了?
例:
sprintf(&buffer[0],"This Is The\
Longest String In the World\
that in text goes on and..");
Run Code Online (Sandbox Code Playgroud)
产生一个输出:
Buffer:This Is The Longest String In the World that in text goes on and..
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?这只是一种尝试在多行代码中分解字符串的错误方法吗?