Я прочитал некоторые другие посты в стеке Oferflow об этой проблеме, но никто из них не решил шахту.
Код: Выделить всё
#include
#include
int main() {
std::string str;
char ch;
str = "Hello";
ch = '!';
str = str + ch;
}
< /code>
Но G ++ сказал, что я не могу объединить строку с символом из -за различных типов. Ошибка G ++: < /p>
no operator "+" matches these operands
Код: Выделить всё
no instance of overloaded function "std::__cxx11::basic_string::append [with _CharT=char, _Traits=std::char_traits, _Alloc=std::allocator]" matches the argument list
Подробнее здесь: https://stackoverflow.com/questions/794 ... -stdstring
Мобильная версия