dimanche 1 août 2021

"Warning: multi-character character constant" when I used a C pointer

Here is a fraction I wrote to print a sentence once someone inputs "time". But when I compiled it, it said "Warning: multi-character character constant". I tried to use double quotes and it said "Warning: comparison between pointer and integers". Now, I'm very confused. Could you help me? Thanks!!!

char *status; 
scanf("%s", status);
if (*status == 'time')`
    {
        printf("The time of the meet-up is 4 p.m.");
    }

Aucun commentaire:

Enregistrer un commentaire