Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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