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.
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
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; }
Last edited by rainmanddw; 01-22-2006 at 08:39 AM.