I have this program that isnt working.
char arr[200] ;
char *p = arr;
cout << "Enter the string and press ENTER: ";
cin.getline(*p,200);
The problem is probably because im using pointers with cin.getline().
My question is
Is it possible to use pointers in cin.getline?
And if yes. Then how?
And if no. Then why not , and how to get around that problem (especially passing a string to a function)?
Yes it’s possible, you just got the syntax wrong.
istream::getline expects a pointer, so there is no need to dereference it, as you did.