i have a pointer that it aint working. plz help.
wut is the problem with the pointer???. the compiler doesnt find an error but when i run it it gives me an illegal operation and i have to close it. any ideas??
Code:
void newperson ()
{
int count, numppl;
char *strp;
*strp = input[20];
cout<<"How many people do you want to introduce?"<<endl;
cin>>numppl;
for (count=0 ; count <=numppl ; count=count +1)
{
cin.get (input, 20);
}
}
thx
one more thing and ill be good.
now it runs fine. except for one major thing. the cin.get (input, 20); does not read anything. it skips that part and keeps going with my program.
Code:
void newperson()
{
int count, numppl;
char *strp=input;
*strp = input[20];
cout<<"How many people do you want to introduce?"<<endl;
cin>>numppl;
for (count=0 ; count <=numppl ; count=count+1)
{
cin.get (input, 20);
}
}
I wonder if i havet to make the "void" into a char newperson (void) and place a return input[20];
plz reply if u have an idea. thx