This is a 3-file program, header file with declarations and 2 source files, one for definition and the other is the actual application file. I am attempting to write a non-member function.
In my header file, I have declared bool isLarger(int x, int y); outside of the class. In my application file, before the end of the program, I have written the following code:
Expand|Select|Wrap|Line Numbers
- bool isLarger(firstDate.convert(), secondDate.convert())
- {
- if (firstDate.convert() > secondDate.convert())
- {
- cout << "The first date entered is the most recent. " << endl << endl;
- return true;
- }
- else
- {
- cout << "The second date entered is the most recent. " << endl << endl;
- return false;
- }
- }
I think that that is what I intended - a function definition. Is there something illegal about this code that I am just not seeing?
Thank you in advance for any help.
Michelle