+ 1
What is a faster way of accessing arrays using ar[x] or by using pointers?
array elements access speed
3 Respuestas
+ 1
i think both are pretty much same since array itself uses the name of its array as a pointer to access the elements.
+ 1
thanks kamal. but accessing arrays using pointers is faster. you have rightly pointed that array itself uses the name of its base element as pointer So internally ar[x] is converted to pointer so if we use pointers it saves the compiler from doing it.
0
By pointers I thought you meant "by taking some external pointer".And then make it point to array.
I actually meant the same thing you have written.