Why does the program crash?
Code:
char* sNameIN;
for(;;)
{
cout<<"Enter a name:"<<endl;
for(int i=0;i<4;i++)
{
cout<<sNames[i]<<endl;
}
cin>>sNameIN;
bool bCMP=false;
for(int ind=0;ind<4;ind++)
{
bCMP=!(strcasecmp(sNameIN,sNames[ind]));
iCount=ind;
if(bCMP==1)
{
goto CharSelect;//"gotoEN"
}
}
}
I don't understand. Earlier in the day, I had this code in my file, it
compiled without error, and the program ran like it should have. Now,
when I try to run it, as soon as it hits the 'cin' line, and the user
hits 'enter' the program crashes. Why, and how do I get around this
P.I.T.A.? Keep in mind that this is of course only the relevant part of the program...