Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 170

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 64

Answer:

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.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 170 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: