行尾的反斜杠是什么意思
我在 mysql 文档中找到了以下代码,但想知道在行尾添加反斜杠是什么意思。
status = mysql_query(mysql,
"DROP TABLE IF EXISTS test_table;\
CREATE TABLE test_table(id INT);\
INSERT INTO test_table VALUES(10);\
UPDATE test_table SET id=20 WHERE id=10;\
SELECT * FROM test_table;\
DROP TABLE test_table");
I have found following code in mysql documentation but wondering what does it mean putting backslash at the end of line.
status = mysql_query(mysql,
"DROP TABLE IF EXISTS test_table;\
CREATE TABLE test_table(id INT);\
INSERT INTO test_table VALUES(10);\
UPDATE test_table SET id=20 WHERE id=10;\
SELECT * FROM test_table;\
DROP TABLE test_table");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在面向行的文本上下文中,尤其是某些编程语言的源代码中,它通常用在行尾以指示应忽略尾随换行符,以便将下一行视为其一部分当前行的。在这种情况下,它可以被称为“延续”。 GNU make 手册说:“我们使用反斜杠换行符将每行长行分成两行;这就像使用一行长行,但更容易阅读。”
In the context of line-oriented text, especially source code for some programming languages, it is often used at the end of a line to indicate that the trailing newline character should be ignored, so that the following line is treated as if it were part of the current line. In this context it may be called a "continuation". The GNU make manual says, "We split each long line into two lines using backslash-newline; this is like using one long line, but is easier to read."
这意味着该语句在下一行继续,就像没有换行一样。
It means that the statement continues on the next line, like there was no line-break.