prev up next   top/contents search

comp.lang.c FAQ list · Question 12.22

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


A: 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).

References: ISO Sec. 7.9.6.5
PCS Sec. 11 p. 175


prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North