S
santosh
Hello,
I have const member in the class.
How can I initialise these.
I can not initialise in constructor ,(it is giving compilation error)
What is the proper way to initialise.
The code is given below.
Regards,
santosh
class NamedPtr
{
const string a;
const int i;
const int* ptr_int;
public:
NamedPtr(const string &s,int * x,int b=90)
{
cout<<"constor"<<endl;
//=b;
//s;
//r_int=x;
}
I have const member in the class.
How can I initialise these.
I can not initialise in constructor ,(it is giving compilation error)
What is the proper way to initialise.
The code is given below.
Regards,
santosh
class NamedPtr
{
const string a;
const int i;
const int* ptr_int;
public:
NamedPtr(const string &s,int * x,int b=90)
{
cout<<"constor"<<endl;
//=b;
//s;
//r_int=x;
}