C++ Function Parameter Creating Temporary Instances with Functional Constructors
#include <iostream> #include <string> using namespace std; void WriteMe(string str) { cout << "Here I am: " << str << endl; } int main()/* w ww . j a va 2 s .co m*/ { WriteMe(string("Sam")); return 0; }