




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















class Student{
…
public:
Studen(); Student(char * aName); void setRollNo(int aNo);
};
int main(){
Student obj; Student *ptr; ptr = &obj; ptr->setRollNo(10); return 0;
}
Breakup of new Operation
Design a class date through which user must be able to perform following operations
class Date
{
int day; int month; int year; static Date defaultDate;
…
};
class Date{ … public: void setDay(int aDay); int getDay() const; void addDay(int x); … … };
Constructors and
Destructors in Date.h Date(int aDay = 0, int aMonth= 0, int aYear= 0);
~Date(); //Destructor
};
Implementation of Date
Class
Date Date::defaultDate (07,3,2005);