O
ofranko
i get the following exception. i have no idea where to begin from.
could someone point me to the solution?
Unhandled exception at 0x5c5aa3d7 (msvcr90d.dll) in
addWithObjects1.exe: 0xC0000005: Access violation writing location
0x012888a0.
class TheDate
{
public:
TheDate(char initialDateBuffer[9]);
~TheDate();
char *GetDateBuffer();
void SetDateBuffer(char dateBuffer[9]);
//void DisplayDate(char theDateBuffer[9]);
private:
char theDateBuffer[9];
};
TheDate::TheDate(char initialDateBuffer[9])
{
strncpy_s( theDateBuffer,9, initialDateBuffer,9);
}
TheDate::~TheDate()
{
}
char *TheDate::GetDateBuffer()
{
cout <<"GetDateBuffer()\n";
return theDateBuffer;
}
void TheDate::SetDateBuffer(char dateBuffer[9])
{
_strdate_s( dateBuffer,9);//gets system date
strncpy_s( theDateBuffer,9,dateBuffer ,9 );
}
could someone point me to the solution?
Unhandled exception at 0x5c5aa3d7 (msvcr90d.dll) in
addWithObjects1.exe: 0xC0000005: Access violation writing location
0x012888a0.
class TheDate
{
public:
TheDate(char initialDateBuffer[9]);
~TheDate();
char *GetDateBuffer();
void SetDateBuffer(char dateBuffer[9]);
//void DisplayDate(char theDateBuffer[9]);
private:
char theDateBuffer[9];
};
TheDate::TheDate(char initialDateBuffer[9])
{
strncpy_s( theDateBuffer,9, initialDateBuffer,9);
}
TheDate::~TheDate()
{
}
char *TheDate::GetDateBuffer()
{
cout <<"GetDateBuffer()\n";
return theDateBuffer;
}
void TheDate::SetDateBuffer(char dateBuffer[9])
{
_strdate_s( dateBuffer,9);//gets system date
strncpy_s( theDateBuffer,9,dateBuffer ,9 );
}