Im a noob in C and I got this simple code working..
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main ()
{
char str1[20]="burke",str2[20];
printf("Dog's name?:");
scanf("%s",str2);
if (strcasecmp(str1, str2)==0){
printf("Gratz you got it",str2);
}
else{
printf("Wrong Answer!!!");
}
getch();
}
My problem is what if instead of "burke" its "burke jr." with space in str1[20] coz somehow i can get it working. >.< been studying C for almost a week now I hope you guys can help me. and give me some tip,hint and advice
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main ()
{
char str1[20]="burke jr",str2[20];
printf("Dog's name?:");
scanf("%s",str2);
if (strcasecmp(str1, str2)==0){
printf("Gratz you got it",str2);
}
else{
printf("Wrong Answer!!!");
}
getch();
}
im gettong Wrong Answer