Quote:why are pointers scary?
int array[10]; int * intptr = array; int value = ask_user_for_item(); printf( "You chose item %d: %d\n", value, intptr[value] ); printf( "Setting it to 0.\n" ); intptr[value] = 0;
Now, if your routine ask_user_for_item() may return values < 0, or > 9, you have a bug in the program, where an arbitrary memory location can be first read, and then set to 0, and there's really no error checking that the compiler can do.
The basic scare with pointers is that a pointer doesn't come with a "minimum" and "maximum" value that you can compare/assert/validate against. If you have a bug that causes a pointer value (or offset) to go out of whack, arbitrary data in your program, entirely un-related to what the pointer is supposed to be doing, will get blasted. This makes for hard-to-find bugs.