It seems that cin.getline is unrecognized in Dev-C++ is there some other function I can use?
I haven't tried fgets() since I want to stick to the C++ style.
Thanks.
Printable View
It seems that cin.getline is unrecognized in Dev-C++ is there some other function I can use?
I haven't tried fgets() since I want to stick to the C++ style.
Thanks.
Dev-C++ recognizes cin.getline just fine (though the global getline and std::string would be better). What's your code?
One thing you'll learn is that when it doesn't work, the problem is in 99.9% of the cases you. Especially if you don't use VC++6.
http://www.cppreference.com/cppstring/getline.html
Code:#include <iostream>
int main()
{
std::string buffer;
while (buffer != "QUIT")
{
std::getline(std::cin,buffer);
std::cout << "You wrote: " << buffer << std::endl;
}
return 0;
}