It doesn't, in this case,
Originally Posted by Zaknafein
i) you don't return the string, the value will not get printed
ii) you didn't pass the string by reference, the value will not get printed.
"name" is passed only by value to the function getname(char n);
printf("your name is %s\n", name);
"n" only exists when the function is called, and is killed (garbage collected) after the "return" statement is called. The value of name in the main function will not be updated.
void getname (char n)
printf("pls enter name: ");
return; // <====== need to return?