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 <stdio.h> | |
#include <cs50.h> | |
void my_function(); | |
string global = "SUPERMAN!"; // global is SUPERMAN and has access to all scopes | |
int main(void) | |
{ | |
global = "FLASH"; // global is FLASH | |
my_function(); // global is BATMAN | |
printf("the global variable is %s\n", global); // global is BATMAN | |
} | |
void my_function() | |
{ | |
global = "BATMAN!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment