format '%s' expects argument of type 'char *'

后端 未结 7 543
野趣味
野趣味 2021-01-11 10:32
#include 
int main(void)
{
    int i,j,k;
    char st;
    printf(\"enter string\\n\");
    scanf(\"%s\", st);         


        
7条回答
  •  余生分开走
    2021-01-11 10:59

    st is type of char &st is type of char * Take care of the difference. BTW, only one char cannot be used to store a string. Use char[] array.

提交回复
热议问题