M
Michael
Hi All,
if I have a class that has a constant as an attribute like this:
class SomeClass {
private:
const int SOME_CONST;
int var;
public:
SomeClass() : SOME_CONST(4),var(0){} // default constructor...is
this right?
void someFunc();
};
if I do it like above I can do this:
SomeClass instance_name();
but I want to be able to call the constructor with a value for var like
this:
SomeClass instance_name(an_integer);
is it possible to do this without having to include a value for the const in
the function call?
Thanks for your help
Michael
if I have a class that has a constant as an attribute like this:
class SomeClass {
private:
const int SOME_CONST;
int var;
public:
SomeClass() : SOME_CONST(4),var(0){} // default constructor...is
this right?
void someFunc();
};
if I do it like above I can do this:
SomeClass instance_name();
but I want to be able to call the constructor with a value for var like
this:
SomeClass instance_name(an_integer);
is it possible to do this without having to include a value for the const in
the function call?
Thanks for your help
Michael