Hi guyz. Sorry for not even knowing what to title this, but here goes.
Suppose I have:
char Fred[] = "1234 Evergreen Terrace";
char Pete[] = "4567 State Street";
char Mark[] = "123 North Street";
char Name[32];
gets(Name);
instead of writing:
if(strcmp(name,"Fred")==0);
printf("You live at %s\n",Fred);
else if(strcmp(name,"Pete")==0);
printf("You live at %s\n",Pete);
else if(strcmp(name,"Mark")==0);
printf("You live at %s\n",Mark);
Isn't there a way to skip all the strcmps() by writing:
printf("You live at %s\n",<SOMETHING_HERE>Name)
My needs are more complex but the above simple example should get me going. It's been nearly 15 years since I learned about it but I just can't recall. Thanks in advance! Dan