Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.