gpt4 book ai didi

c++ - 如何将 "invalid operands of types ' const char' 修复为二进制 'operator+'?

转载 作者:可可西里 更新时间:2023-11-01 15:37:22 30 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How do I concatenate multiple C++ strings on one line?

根据 this C++ std::string 使用 operator+ 连接。那么为什么这段代码

using namespace std;
string sql = "create table m_table(" +
"path TEXT," +
"quality REAL," +
"found INTEGER);";

导致这个错误?

invalid operands of types 'const char [22]' and 'const char [17]' to binary 'operator+'

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com