printf to stderr in C/C++

Problem:

You want to use printf to print something to the stderr stream (instead of stdout)

Solution

Use fprintf(stderr, ...)

For example use

fprintf(stderr,"Senselessly printing %d\n",128);

instead of

printf("Senselessly printing %d\n",128);