小编Rob*_*len的帖子

通过函数传递字符串.C

void printInstructions();
char *getUserWord();


int main()
{
    printInstructions();
    char *baseWord = getUserWord();
    printf("%s", baseWord);
    return 0;
}


void printInstructions()
{
    printf("                      Instructions:                        \n"
   "===================================================================\n"
   "= This program is a hangman game.                                 =\n"
   "= The first user will enter the name to be guessed                =\n"
   "= After that, the second user will guess the letters of the word  =\n"
   "= the second user will loose if they have three strikes           =\n"
   "===================================================================\n");
   return;
}


char *getUserWord()
{
    static char str[20];
    scanf("%s", …
Run Code Online (Sandbox Code Playgroud)

c arrays string function

2
推荐指数
1
解决办法
132
查看次数

标签 统计

arrays ×1

c ×1

function ×1

string ×1