Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <stdio.h>
#include <cs50.h>
string my_function();
string global = "SUPERMAN!";
int main(void)
{
// Using global variables.
// In this case there are no copies.
// The original global variable
// is modified
global = "FLASH";
my_function();
printf("the global variable is %s\n", global);
}
string my_function()
{
global = "BATMAN!";
return global;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment