#include using namespace std; string theVar{"Global Scope"}; void Fun1(string theVar); void Fun2(void); int main() { cout << "Starting main: " << theVar << endl << endl; string theVar{"Start of main"}; cout << "Main, after declaring theVar: " << theVar << endl << endl; { cout << "Main, starting the block: " << theVar << endl << endl; string theVar{"In the block"}; cout << "Main, starting the block: " << theVar << endl << endl; } cout << "Main, after block: " << theVar << endl << endl; for(string theVar = "forLoop"; theVar == "forLoop"; theVar = "end"){ cout << "Main, For Loop: " << theVar << endl << endl; } cout << "Main, after for: " << theVar << endl << endl; //string theVar{"inside main"}; cout << "Main, Before Fun1: " << theVar << endl << endl; Fun1("An argument"); cout << "Main, after Fun1 Before Fun2: " << theVar << endl << endl; Fun2(); cout << "Main, after Fun2: " << theVar << endl << endl; return 0; } void Fun1(string theVar) { cout << "Fun1 " << theVar << endl << endl; } void Fun2(void) { cout << "Fun2 start" << theVar << endl << endl; string theVar {"In fun 2"}; cout << "Fun2 after declaration" << theVar << endl << endl; }