//for destroying variables created dynamically using new operator
#include <iostream>
using namespace std;
class Example
{
private:
int *ptr;
public:
Example() //constructor
{
ptr=new int[2];
#include <iostream>
using namespace std;
class Example
{
private:
int *ptr;
public:
Example() //constructor
{
ptr=new int[2];
//allocate a new integer array, place its address in ptr
}
void getdata()
{
cout<<"Enter two data:";
cin>>*(ptr)>>*(ptr+1);
}
int getsum()
{
}
void getdata()
{
cout<<"Enter two data:";
cin>>*(ptr)>>*(ptr+1);
}
int getsum()
{
No comments:
Post a Comment