This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
sizeof an array data member
HI All,
I realise this might be a dumb question, but here goes.
if I have a method:
const int operator[](const char *) const {
int len;
int numer = sizeof (this->data);
int denom = sizeof data[0];
len = numer / denom;
return len;
}
and a private data member....
private:
float * data;
that I use as an array of floats by alocating to it with new[],
why does the [] overload always return 1? I was hopeful that
it might give me the size of the array!
Thanks,
Matt