Skip to content

Instantly share code, notes, and snippets.

@dibakarsutradhar
Created September 14, 2018 18:51
Show Gist options
  • Save dibakarsutradhar/69e7a14682490847f8b6584a0b61d133 to your computer and use it in GitHub Desktop.
Save dibakarsutradhar/69e7a14682490847f8b6584a0b61d133 to your computer and use it in GitHub Desktop.
#include <iostream>
// global variables
int global = 10;
// main function
int main() {
// local variables with same name
int global = 5;
std::cout << "Value of Global Variable's global is: " << ::global << std::endl;
std::cout << "Value of Local Variable's global is: " << global << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment