Which is faster way to use an element pointer rather than an index when scanning arrays? need some clarification why?
vishalonne
12
Junior Poster in Training
Recommended Answers
Jump to PostThe difference is sooo small that it doesn't really matter. If there is any difference at all it's probably measured in just a few nanoseconds. And a good compiler optimizer will most likely make them both the same. What you should be asking is which is simpler to read, which …
Jump to PostThere is generally no difference between using an index or using a pointer. Using pointers is technically faster, but using an index will usually result in the same code once the compiler has optimized it (unless it is really bad at optimizing or that the context makes the preservation of …
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
vishalonne
12
Junior Poster in Training
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
vishalonne
12
Junior Poster in Training
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.