It would be easier for INTERPOL to issue an international arrest warrant for Bjarne Stroustrup.
I have read countless times that pointers can be accessed as arrays with an integer index. Now Please Mr Bjarne Strapon, give me an exhaustive list of all the situations in which an array can not be accessed with an integer index, and tell me what, if anything can be used instead.
Could I use an index of type 'dildo_widget'? And if not, where do you think I'm going to shove it?
ne555 wrote:
My guess is that you didn't declare an array but just one object.
|
No, I declared a char pointer. And not that I think that it would matter I allocated memory for it with new [] in the constructors.
I did find however that I needed to initialize the pointers to null and fixed the line in firstemptyc() to:
while(!c[counter] == 0)
That however and now I'm getting an error same as before for an int pointer as well.
1 2 3 4 5 6 7 8 9 10 11
|
for (int i = 0; i < maximumsizeofarrays; ++i)
{
//i[i] = 0;
c[i] = 0;
b[i] = 0;
d[i] = 0;
f[i] = 0;
s[i] = "";
cp[i] = 0;
index[i] = 0;
}
|
That is from my constructors. It will compile as is because I have commented out i[i] = 0; I had been getting error: invalid types int[int] for array subscript, although the rest of the pointers seem to be behaving fine in this section.