Hi,
There are two different getline() function:
In the <iostream>, we could try to use the following code:
char Indata[256];
std::cin.getline (Indata, sizeof (Indata));
In the <string>, we could try to use the following code:
std::string Indata;
getline (std::cin, Indata);
For more details I suggest you could refer to the link: https://stackoverflow.com/questions/4872361/why-are-there-two-different-getline-functions-if-indeed-there-are
Best Regards,
Jeanine
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.