Get the latest tech news

Getting silly with C, part (void*)2


They won't be able to find bugs in your code if they can't figure out how it works.

You will be delighted to discover that the following code compiles cleanly with gcc- Wall — and that it calls puts() exactly once ( link): The final piece of the puzzle is the observation that parentheses can be added in variable definitions with no ill effects ( link): Recent versions of GCC allow the iterator variable of a for() loop to be a function declaration, so we can bury the renaming there!

Get the Android app

Or read this on Hacker News

Read more on:

Photo of void*)2

void*)2