Monday 1 April 2013

Which version do you prefer of the following two,


    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.


Blog Author: Vijay Kumar

No comments:

Post a Comment