chrismiceli
01-24-2003, 01:27 AM
i have this code
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
void main() {
char c;
printf("Please make your treat selection:\n");
scanf("%s",&c);
c=toupper(c);
switch(c)
{
case 'H':
printf("Beverage\nThat will be $2\n");
break;
}
}
but if i changed 'H' to 'HE' my gcc compiler give me an error. could someone explain?
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
void main() {
char c;
printf("Please make your treat selection:\n");
scanf("%s",&c);
c=toupper(c);
switch(c)
{
case 'H':
printf("Beverage\nThat will be $2\n");
break;
}
}
but if i changed 'H' to 'HE' my gcc compiler give me an error. could someone explain?