3 ms·
This is very cool, although a more compact way to check for single line comments (introduced in C99) versus division using "//* */". I used that trick here: h
by omoikane 1y ago
This is very cool, although a more compact way to check for single line comments (introduced in C99) versus division using "//* */". I used that trick here:
https://github.com/ioccc-src/winner/blob/a1c86c8a7a533e3c2cd9c883e0ac10926695aa0c/2015/yang/prog.c#L16 https://github.com/ioccc-src/winner/blob/a1c86c8a7a533e3c2cd...
- dogline 1y agoYou gave an IOCCC snippet as an example of a C99 coding trick you know? I mean, the code looks visually cool, but it's funny to explain a code concept using code shaped like an anime character. (At least that's what I think it is.)
- omoikane 1y agoI don't know how to link to just a specific part of the line, but the interesting bit is at the end of line 16 and the start of line 17: x*=02//* */2 -1; With C89, this is evaluated as "x *= 02 / 2 - 1", or "x *= 0". With C99, this is evaluated as "x *= 02 / -1", or "x *= -2".