C: problem with char*

前端 未结 7 411
遥遥无期
遥遥无期 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:11

    Type char* sPhrase[] is really incompatible with char *, [] has semantic of pointer, so you code much to char **. So function signature must be:

    char* reverse(char* sPhrase)
    

提交回复
热议问题