Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’

后端 未结 6 527
野性不改
野性不改 2020-11-28 20:36

At the top of my file I have

#define AGE \"42\"

Later in the file I use ID multiple times including some lines that look like



        
6条回答
  •  無奈伤痛
    2020-11-28 20:57

    I had the same problem in my code. I was concatenating a string to create a string. Below is the part of code.

    int scannerId = 1;
    std:strring testValue;
    strInXml = std::string(std::string("" \
                            "" + scannerId) + std::string("" \
                            "" \
                            "" + testValue) + "" \
                            "FALSE" \
                            "FALSE" \
                            ""\
                            "");
    

提交回复
热议问题