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) | |
{ | |
// This version solves the previous issue from variable_scope_1.c | |
// We assign the returned value of our order_turkey function | |
string meat = "ham"; | |
printf("You ordered a %s and cheese sandwich\n", meat); | |
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