This should be a fairly simple question, but how do I get a whole line from a file and store it as a string?
This is what I have right now:
All it spits out is the first word though.Code:int main() { string a = ""; string b = ""; string fileName = ""; cout << "Enter file name (case sensative): "; cin.ignore(); cin >> fileName; ///////////////////////////////////////////////////////////////////////// // Input File ///////////////////////////////////////////////////////////////////////// try { ifstream b_file(fileName.c_str()); b_file >> a; b_file.close(); //more stuff... }



LinkBack URL
About LinkBacks


