C: problem with char*

前端 未结 7 477
遥遥无期
遥遥无期 2021-01-22 07:38
/*
 * code.c
 *
 * TASK
 *      Reverse a string by reversing pointers. Function should use return
 *      type char* and use a char* parameter as input.
 */
#include &l         


        
7条回答
  •  死守一世寂寞
    2021-01-22 08:06

    I'm kind of new to pointers, and c in general, but it looks like reverse() is expecting a pointer and you're passing it an actual array of chars. try changing the line:

    char sPhrase[STRMAX];
    

    to:

    char *sPhrase[STRMAX];
    

提交回复
热议问题