Created
May 21, 2017 11:53
-
-
Save bradenmacdonald/e54e25452ee9dc0bbdb29a6388283b34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using std::string; | |
string name = "Alice"; | |
void foo() { | |
std::cout << "Hello " << name << std::endl; | |
} | |
void bar() { | |
std::cout << "Hello " << name << std::endl; | |
string name = "Bob"; | |
std::cout << "Hello " << name << std::endl; | |
} | |
int main() { | |
foo(); | |
bar(); | |
return 0; | |
} | |
// Output: | |
// Hello Alice | |
// Hello Alice | |
// Hello Bob |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment