- #1
DivGradCurl
- 372
- 0
In my program have a function like this:
My problem is reading the input using the pointer to a string. The program simply skips that part. It is weird that "getline" works if I'm using the commands within the main. Yes, I prototype and call the function in addition to passing the inputs. It does not seem to be trivial. I've spent a lot of time trying to fix this, but no success so far.
Any help is highly appreciated.
Code:
void * changeInfo(bool *flag, string *NewName)
{
if (!(*flag))
{
cout << endl << "Enter the new Name: ";
getline(cin, *NewName);
cout << *NewName;
}
}
My problem is reading the input using the pointer to a string. The program simply skips that part. It is weird that "getline" works if I'm using the commands within the main. Yes, I prototype and call the function in addition to passing the inputs. It does not seem to be trivial. I've spent a lot of time trying to fix this, but no success so far.
Any help is highly appreciated.