3 ms·
Do you actually know what *p++ does in C?
- csense 14y agoIt needs parentheses, because even if you know what it does, the code might one day be maintained by someone who doesn't.
- lmm 14y agoYes, I do. Unfortunately the author of this article doesn't, and didn't bother to test his examples before making entirely false claims. The following example will do something very different from what the article says: int myarray[4]= {1,2,3,0}; int *p = myarray; while ((*p)++) { printf("%d ", *p); }
- musepwizard 14y agoHi lmm. Thanks for catching that. I have updated the article code with the fixes. This is my first blog post ever. That will teach me not to post without fulling checking the code.