Monday, May 24, 2010

printf conundrums

Very few authors discuss the "printf", included in the stdio (please do not call it "studio") function in complete detail - its functionality, sequence of executing the arguments and so on... Here are a few questions to get you thinking:

1. In what order does printf accept and execute the arguments : printf ("A1 = %d, A2 = %d", int_arg1, int_arg2);

2. What does printf print in this case: printf ("Here = %d and There = %d");
Most of you would say "garbage". But what is that garbage and where does it come from?

Lemme see some accurate answers

Why are you here...

This blog discusses some of the trick questions in C. The ones that baffle you. The ones that seem fine, but never work. The ones that the make you sweat while the interviews fancies a grin.