Arrays

I am attempting to implement functions in a .cpp file from a .h file any advice would be great thank you


class Date
{
public:
Date();
Date(unsigned short mth, unsigned short dy, unsigned long yr);
~Date();
unsigned short getMonth();
unsigned short getDay();
unsigned long getYear();
void setMonth(unsigned short mth);
void setDay(unsigned short dy);
void setYear(unsigned long yr);
]
Just include this header in the source file you wish to implement it in.

Then include the header file wherever you need to use this class.
Your declarations seem sane.

The implementation is what will go in a C++ file that includes the header file.

You may want to take a look here for some examples of syntax. I know it's a one-file example, but anything that's there that deals with non-inline implementation can be comfortably moved to your implementation file.
http://www.cplusplus.com/doc/tutorial/classes/

-Albatross
Last edited on
Thank you both
Topic archived. No new replies allowed.