passing value to a function

sprintf returns the length of the string it generated.