Passing Arguments by Value
#include <iostream> #include <string> using namespace std; void printMessage(string); int main () { string str; cout << "Enter a string: "; cin >> str; printMessage(str); return 0; } void printMessage (string s) { cout << "You inputted " << s; }