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

You have a type mis-match.
scanfis not type safe, You need to provide proper type. scanf enables you to get data from the input and you need to tell it what is the type of the data you want it to read. You ask it to read a string by specifying %s by provide it with a character variable.

You need an array:

#define MAX_LENGTH 256
char st[MAX_LENGTH];

As @Jerry rightly points out, You can just simple avoid all the hassle by using:
getline() instead of using scanf


char st is a single character. Judging by the rest of your code, you probably intended to declare an array of characters:

char st[80];

scanf needs a pointer to char* to indicate you are scanning a string.

You are supplying a character that's allocated on the stack.

You either want to use a getchar() or make st a char array.

Tags:

C