Wednesday, 6 August 2014

Which version do you prefer of the following two,


1) printf(“%s”,str);      // or the more curt one
2) printf(str);

Answer & Explanation:

Prefer the first one. If the str contains any  format characters like %d then it will result in a subtle bug. 

No comments:

Post a Comment