Sunday, July 12, 2009

Why do c pointers are faster than variables accessing?

why the accesing time is fast of pointers than that of variables

Why do c pointers are faster than variables accessing?
When accessing a variable there may be a need to compute the address of the variable, while the pointer has that address already computed. For example, if the variable is an element of


an array, accessed as a[b], a computation of the address using


b would be necessary, making it slower.


No comments:

Post a Comment