I have a class that consists of a parameterized constructor which I need to call while creating an object. The class also contains a private copy constructor restricting to create an object to it. Now how to call the paramter constructor of this class. I think we can create a pointer reference to the class. But how to call the parameter constructor using the reference?
My Program:
#include<iostream>
#include<string>
using namespace std;
class ABase
{
protected:
ABase(string str) {
cout<<str<<endl;
cout<<"ABase Constructor"<<endl;
}
~ABase() {
cout<<"ABASE Destructor"<<endl;
}
private:
ABase( const ABase& );
const ABase& operator=( const ABase& );
};
int main( void )
{
ABase *ab;//---------How to call the parameter constructor using this??
return 0;
}