++someVariable vs. someVariable++ in JavaScript

Same as in other languages: ++x (pre-increment) means “increment the variable; the value of the expression is the final value” x++ (post-increment) means “remember the original value, then increment the variable; the value of the expression is the original value” Now when used as a standalone statement, they mean the same thing: The difference comes when you … Read more

How to printf a memory address in C

Use the format specifier %p: The standard requires that the argument is of type void* for %p specifier. Since, printf is a variadic function, there’s no implicit conversion to void * from T * which would happen implicitly for any non-variadic functions in C. Hence, the cast is required. To quote the standard: 7.21.6 Formatted … Read more