Erik
2013-05-29 17:21:15 UTC
01January
02February
03March
and so on.
Im just not sure what data type I should use for the input of the date, and how to compare the 2 characters in the middle of that input, and search for those characters in text file. I understand I need to use month.Stringfind(), but Im quite new to programming so Im not sure how. This is what I got so far.
// reading a text file
#include
#include
#include
using namespace std;
int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while ( myfile.good() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
This is the first time my prof has taught a class, and she is wayy behind in our lectures, so the assignments are way more complicated than what she has taught us so far. Thats why I need to look through the internet for help, so any help is greatly appreciated!