   Is there a difference between array[0].var and array->var?
  Is there a difference between array[0].var and array->var?Thanks 
  Nope, there shouldn''t be any difference.array.var is equal to (array + sizeof(arraytype)*i)->varAnd in your example i is equal to 0! :-)   --------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened... ;  "Nope, there shouldn''t be any difference.array.var is equal to (array + sizeof(arraytype)*i)->varAnd in your example i is equal to 0! :-) "Actually, doing (array + sizeof(arraytype)*i)->var will probably crash your program. All you need to do is (array + i)->var. The compiler already knows what data the pointer points to and increments it correctly. array++ and array-- also move the array pointer around. Have fun with them. :]CD   Jesus is Lord!! ;  He meant in bytes . ;  Yes there is a difference.AssumingstructureType array[3];then you would usearray[0].var.Now if you have a pointer to the array...structureType *array[3];then you would usearray->varSince this form of dereferencing (->) is equivalent to*array[0].varwhich is equivalent to*(array + 0).var as described above, with *(array + 2).var being the last ''var'' field of the array.Why do you not need to specify sizeof(structureType) in your conversions? C/C++ can imply the size of memory to skip in order to get to the next element.  ;  Functionally there is no difference: #include <iostream>class Test{public:int function(){return 7;}};int main(){Test array[7];std::cout << array[0].function() << ''\n'';std::cout << array->function() << ''\n'';std::cout << 0[array].function() << ''\n'';}The third version is particularly fun!Enigma ;  That third one set me off! ;quote:Is there a difference between array[0].var and array->var?the difference is that you use array->var when you want to be a jerk and dont want anyone else to be able to read your code...jk ;  Pointers are very fun indeed.for(){Pointer++.eatMe();}   --You''re Welcome,Rick Wong- sitting in his chair doing the most time-consuming thing.. ;  Hehe, i like thestd::cout << 0[array].function() << ''\n'';form Also Pipo DeClown''s code looks pretty idiotic. 