yes a pointer points to an address..but since you use the 'new' operator..which allocated memory off the heap..it is pointing to the new allocated memory you just supply for it..isnt dynamic memory allocation beauitful?
this allocates an array of ints..4 bytes (visual c++) time counter amounts.
well when you useCode:pointer=new int[counter];
it is the same asCode:pointer[x]
why wouldn't this work?Code:*(pointer + x)
because thats like sayingCode:total+=pointer[x]*;
pointers and arrays are very similar in c++Code:total += *(pointer + x)*;