Mar 7, 2011 at 2:28pm
Hello.
Is there a way to avoid different strings while using fopen?
Example:
Input (the file):
Say Hello!
Hello
Name please.
John |
The code:
1 2 3 4 5 6 7
|
inFile.open(aFile);
Avoid("2 string"); // Help.
inFile >> GetAString;
Avoid("next 2 strings"); // Help.
inFile >> GetAnotherString;
inFile.close();
cout << GetAString << ", my name is " << GetAnotherString << "." << endl;
|
Output (console screen):
I hope you understand what I mean.
Any help appreciated.
Last edited on Mar 7, 2011 at 2:32pm