Basic and Advance C Question:
Download Questions PDF

What is the deal on sprintfs return value?

Answer:

What's the deal on sprintf's return value? Is it an int or a char *?

The Standard says that it returns an int (the number of characters written, just like printf and fprintf). Once upon a time, in some C libraries, sprintf returned the char * value of its first argument, pointing to the completed result (i.e. analogous to strcpy's return value).

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
Why does everyone say not to use gets?Why does everyone say not to use scanf? What should I use instead?