C++代码中字符串分多行时的情况

#include <iostream>
int main(const int argc, const char* argv[])
{
    std::string strSql1 = "select * from table \
    where id = 1 \
    and name='name'";
    std::cout << strSql1 << std::endl;

    std::string strSql2 = "select * from table"
                          "where id = 1 "
                          "and name='name'";
    std::cout << strSql2 << std::endl;

    return 0;
}

结果:

posted @ 2023-06-30 14:27  dilex  阅读(134)  评论(0编辑  收藏  举报