RosettaCodeData/Task/Copy-a-string/C++/copy-a-string.cpp

11 lines
309 B
C++
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
#include <iostream>
#include <string>
int main( ) {
2014-01-17 05:32:22 +00:00
std::string original ("This is the original");
std::string my_copy = original;
std::cout << "This is the copy: " << my_copy << std::endl;
original = "Now we change the original! ";
std::cout << "my_copy still is " << my_copy << std::endl;
2013-04-10 23:57:08 -07:00
}