A userdefined class named Timer has a constructor that takes
Solution
#include<iostream.h>
#include<conio.h>
#include <stdlib.h>
#include <time.h>
//using namespace std;
int * randArray(int);
int * array;
class Timer
{
int hour,minute;
public:
Timer(int x,int y)
{
hour=x;
minute=y;
}
public :
int * randArray(int n)
{
srand((unsigned)time(0));
for(int i=0; i<n; i++)
{
array[i] = (rand()%100)+1;
cout <<array[i]<<\"\ \";
}
return array;
}
public :~Timer()
{
delete array;
}
};
int main() {
Timer * timePtr;
int * arr;
clrscr();
timePtr= new Timer(10,20);
arr=timePtr->randArray(100);
// The Below Code is for checking that we got same return array
//it\'s upto you if you need below code please uncoment it otherwise keep coment
/* cout<<\"Inside The Main Method\"<<endl;
for(int i=0;i<100;i++)
{
cout <<arr[i]<<\"\\t\";
} */
delete arr;
cout<<\"After deleting The memmory\"<<endl;
cout<<\"!bye bye\";
getch();
return 0;
}

