fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. std::string myString;
  6. std::string someString;
  7. std::string otherString;
  8. myString += someString += "text" += otherString += "more text";
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:8:35: error: no match for 'operator+=' (operand types are 'const char [5]' and 'std::basic_string<char>')
  myString += someString += "text" += otherString += "more text";
                                   ^
stdout
Standard output is empty