View Single Post
  #2 (permalink)  
Old January 12th, 2004, 04:49 PM
nikolai nikolai is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why don't you compile it to see the result yourself?


To be brief, the reason you can't do something like that is because "i" is an integer variable, NOT a pointer or array variable, so you can't access it via some index.

Also, "a" IS an array variable. Technically, "a" is the name of the array but acts internally as a pointer to the first index in the array. As such, the value of "a" is the address in memory where the array variable is stored. These memory locations are just numbers, so theoretically this value can be cast as an integer for use in an array index, but it doesn't make sense to do so. Ever.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote