I'm not sure of exactly how your files are structured but this is what you would want:
(I just used "doty" to shorten the filename)
A file called doty.h which has:
Code:
#inndef DOTY_H
#define DOTY_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
class dayoftheyear
{
public:
//constructor
dayoftheyear();
//destructor
~dayoftheyear();
void output();
int month;
int day;
};
#endit DOTY_H
A file called doty.cpp which has:
Code:
#include "doty.h"
dayotheyear::dayoftheyear()
{
//clean out any previous variable values
month=0;
day=0;
}
dayoftheyear::~dayoftheyear()
{
//clean up when you're done
month=0;
day=0;
}
void dayoftheyear::output()
{
char cDay[20], cMonth[20];
_itoa(day,cDay,10);
_itoa(month,cMonth,10);
strcat(cMonth,"/");
strcat(cMonth,cDay);
MessageBox(NULL,cMonth,"debug",NULL);
}
In your main *.cpp file:
Code:
#include "doty.h"
dayoftheyear dotyDay;
Of course, I filled in the output function with a some generic stuff, just for the sake of example. Is this how your files are structured? Also, I recommend having at least 2 more functions ( 1 to set the day value and 1 to set the month value, if not even 2 additional functions to return the values set from the day and month individually ).