[Solved] What code is more CPU expensive: while(*p) or while(i–)? [closed]
*pointer nominally requires a fetch from memory, and that is generally the most expensive of the operations shown in your code. If we assume your code is compiled directly to the obvious assembly corresponding to the operations as they are described in C’s abstract machine, with no optimization, modern CPUs for desktop computers are typically … Read more