I am having trouble associating the month names with the month numbers. When the program runs, it should output the date in three styles.
Also I do not know if my input validations work correctly(day cannot be greater than 31 or less than 1, month cannot be greater than 12 or less than 1).
The problem now is that you're checking "month" and "day", which haven't been assigned to yet. You need to check the parameters "m" and "d" for validity.
Also, other than this, the program seems to work - what problems are you having with the association of month to month name?
Your first program here works fine, the only thing I added was an #include <string> statement in the beginning. Only problem I see is when you put in the wrong month or day it freezes the console.
Note: I think what L B was trying to tell you in his first post is you should more your if statements into your do while loop so you ask when the input is given, this will stop the freezing, or should. What it is doing is asking for the date and accepting them, then when you go look in the class it is not there, which is bad.
These two lines give me errors. It says that no operator << matches these operands. It must be something with my compiler. I'm using Microsoft Visual C++ 2010 Express.
The errors are...
Error 1 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) c:\users\fred steinman\documents\visual studio 2010\projects\date class\date class\date class.cpp 85
Error 2 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) c:\users\fred steinman\documents\visual studio 2010\projects\date class\date class\date class.cpp 86
3 IntelliSense: no operator "<<" matches these operands c:\users\fred steinman\documents\visual studio 2010\projects\date class\date class\date class.cpp 85
4 IntelliSense: no operator "<<" matches these operands c:\users\fred steinman\documents\visual studio 2010\projects\date class\date class\date class.cpp 86