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

后端 未结 7 513
野趣味
野趣味 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:49

    As others have mentioned you want to create an array:

    Change char st; to char st[10]; or whatever size array you want.

    With the above change st is an array that has 10 individual elements that can hold a single char value.

提交回复
热议问题