#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main()
{
string buf;
cout<<"Enter a string: ";
getline(cin,buf);
system("pause");
}
In dev-c++ this would compile fine but visual c++ tell me getline() is undefined... I googled and found nothing, and I'm not talking about cin.getline(), I'm talking about getline(cin,buffer), any clue?
hellzlaker - Fri Dec 05, 2008 4:52 pm Post subject:
nevermind, the problem was it needs to be #include <string> not <string.h>