Last active
January 19, 2021 22:51
-
-
Save sojohnnysaid/2c9fe197b370c15150d36df191e69864 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 <stdio.h> | |
#include <cs50.h> | |
string order_turkey(string); | |
int main(void) | |
{ | |
// And example of scope and passing by value | |
// This code passes a variable by value | |
// Because we don't store the variable returned | |
// We can't use it in main() | |
string meat = "ham"; | |
printf("You ordered a %s and cheese sandwich\n", meat); | |
order_turkey(meat); | |
printf("You ordered a %s and cheese sandwich\n", meat); | |
} | |
string order_turkey(string m) | |
{ | |
m = "turkey"; | |
return m; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment