+2 votes

I have used them but same output !

Whats the difference between them fprintf and sprintf ?

asked May 24, 2016 in Computer Science - IT by techdoubt | 556 views
Good Question +1

1 Answer

+1 vote
Selected Ans.

Yes, they seem to have same behavior but there is a difference :

fprintf prints the variable in a command window or a file, 

but in case of sprintf , they can be used to create a string ,

returns the results to character vector str

Example  :

Official documentation :




answered May 28, 2016 by slow_learner
selected May 31, 2016 by techdoubt