C
Christopher
I could of sworn you could get the value of a static member of a class using
this syntax "class::member" but my compliler is complaining. How can I do
what I am trying to do here besides making a function for it. Isnt there a
short easy way? Oh and my instructor wont let me use a #define because he is
a terd.
the header:
class BigPosInt
{
public:
static const int MAX_DIGITS = 30;
// snip...
};
the function in question:
void input(istream& ins, BigPosInt& targetBpi)
{
int counter = 0;
char one_byte;
int buffer[BigPosInt::MAX_DIGITS];
// snip..
}
the error:
BigPosInt.cpp:170: `MAX_DIGITS' undeclared (first use this function)
Thanx,
Christopher
this syntax "class::member" but my compliler is complaining. How can I do
what I am trying to do here besides making a function for it. Isnt there a
short easy way? Oh and my instructor wont let me use a #define because he is
a terd.
the header:
class BigPosInt
{
public:
static const int MAX_DIGITS = 30;
// snip...
};
the function in question:
void input(istream& ins, BigPosInt& targetBpi)
{
int counter = 0;
char one_byte;
int buffer[BigPosInt::MAX_DIGITS];
// snip..
}
the error:
BigPosInt.cpp:170: `MAX_DIGITS' undeclared (first use this function)
Thanx,
Christopher