Best C Questions

C
 


Obfuscated C Code Contest 2006. Please explain sykes2.c

How does this C program work? main(_){_^448&&main(-~_);putchar(--_%64?32|-~7[__TIME__-_/8%8][">'txiZ^(~z?"-48]>>";;;====~$::199"[_*2&8|_/64]/(_&2?1:8)%8&1:10);} It compiles as it is (tested on gcc 4.6.3). It prints the time ...

C Programming Tips

C is one of the most important and widely used of all programming languages. It is a powerful language that ...

Improve INSERT-per-second performance of SQLite?

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts-per-second to over 96 000 inserts-per-second! ...

With C arrays, why is it the case that a[5] == 5[a]?

As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention ...

Why doesn’t GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)?

I am doing some numerical optimization on a scientific application. One thing I noticed is that GCC will optimize the ...

What is “:-!!” in C code?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if condition is true, but also ...