K
kwangbok.kim
Hi.
I'm major in computer science.
While studying with the what kind of document, the problem got.
Please help me.
The lower part is the program...
Programming with visual c++ 6.0 at windows xp
--------------------------------------------------------------------------------------------
#include <iostream.h>
#include <string.h>
class Date
{
int d, m, y;
public:
Date(int dd=5, int mm=5, int yy=2005) : d(dd), m(mm), y(yy)
{
cout << "Date Object Created .. " << endl;
}
~Date()
{
cout << "Date : " << y << "/" << m << "/" << d << endl;
}
void print();
};
void Date:
rint()
{ cout << "Date : " << y << "/" << m << "/" << d << endl; }
class Person
{
char *name;
Date *birthday;
public:
Person(char *n, Date *d);
~Person()
{
delete[] name;
cout << "Person Object Destructed .. " << endl;
}
void print();
};
Person:
erson(char *n, Date *d) : birthday(d)
{
name = new char[strlen(n) +1];
strcpy(name,n);
cout << "Person Object Created .. " << endl;
}
void Person:
rint()
{
cout << "Name : " << name << endl;
cout << "Birthday : ";
birthday->print();
cout << endl;
}
int main(void)
{
Date day(1,1,1973);
Person hong("Hong, Gin-Dong", &day);
hong.print();
Person jang = hong;
jang.print();
return 0;
}
I'm major in computer science.
While studying with the what kind of document, the problem got.
Please help me.
The lower part is the program...
Programming with visual c++ 6.0 at windows xp
--------------------------------------------------------------------------------------------
#include <iostream.h>
#include <string.h>
class Date
{
int d, m, y;
public:
Date(int dd=5, int mm=5, int yy=2005) : d(dd), m(mm), y(yy)
{
cout << "Date Object Created .. " << endl;
}
~Date()
{
cout << "Date : " << y << "/" << m << "/" << d << endl;
}
void print();
};
void Date:
{ cout << "Date : " << y << "/" << m << "/" << d << endl; }
class Person
{
char *name;
Date *birthday;
public:
Person(char *n, Date *d);
~Person()
{
delete[] name;
cout << "Person Object Destructed .. " << endl;
}
void print();
};
Person:
{
name = new char[strlen(n) +1];
strcpy(name,n);
cout << "Person Object Created .. " << endl;
}
void Person:
{
cout << "Name : " << name << endl;
cout << "Birthday : ";
birthday->print();
cout << endl;
}
int main(void)
{
Date day(1,1,1973);
Person hong("Hong, Gin-Dong", &day);
hong.print();
Person jang = hong;
jang.print();
return 0;
}