what is the diff between the printf and sprintf functions??
and what is the syntax for this two functions ??

Answer Posted / jack

The printf subroutine converts, formats, and writes the
Value parameter values, under control of the Format
parameter, to the standard output stream.

The sprintf subroutine converts, formats, and stores the
Value parameter values, under control of the Format
parameter, into consecutive bytes, starting at the address
specified by the String parameter. The sprintf subroutine
places a null character (\0) at the end. You must ensure
that enough storage space is available to contain the
formatted string.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 data types?

597


What does a function declared as pascal do differently?

603


Why should I prototype a function?

630


How would you rename a function in C?

614


What are the types of operators in c?

610






When should structures be passed by values or by references?

581


What library is sizeof in c?

568


What is difference between far and near pointers?

604


When is a “switch” statement preferable over an “if” statement?

643


What is sizeof array?

606


What is abstract data structure in c?

523


Is c is a high level language?

618


What are the modifiers available in c programming language?

733


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3280


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

657