Pointers to Array.. (Please this post to software)

It seems like there is some error in pointing to array with only one item in it...

//pseudocode...
int cracker[0];

falutyClass{
public:
int *ptr;
}

faultyClass myClass;

setup{
myClass.ptr = &cracker[0];
}

The exact same code works if i change int cracker[0] to int cracker[1].
I do not get any errors from the compiler or so... It just won't work.
Is this an error or am I just plain stupid?

Err....it is an error :slight_smile:

Declaring int cracker[0]; says you want an array with 0 elements. You want an array with 1 element, so replace 0 with 1.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

Thanks....