Answers for "http://www.cplusplus.com/reference/string/string/operator+=/"

C++
3

http://www.cplusplus.com/reference/string/string/operator+=/

// string::operator+=
#include <iostream>
#include <string>

int main ()
{
  std::string name ("John");
  std::string family ("Smith");
  name += " K. ";         // c-string
  name += family;         // string
  name += '\n';           // character

  std::cout << name;
  return 0;
}
Posted by: Guest on March-08-2020

Code answers related to "http://www.cplusplus.com/reference/string/string/operator+=/"

Browse Popular Code Answers by Language