What is the purpose of sprintf() function?
Long Answer
Views 1160
Answer:
The sprintf() stands for "string print." The sprintf() function does not print the output on the console screen. It transfers the data to the buffer. It returns the total number of characters present in the string.
Syntax
Let's see a simple exampleint sprintf ( char * str, const char * format, ... );
Output:#include int main() { char a[20]; int n=sprintf(a,"javaToint"); printf("value of n is %d",n); return 0; }
value of n is 9
Related Articles:
This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of C Programming Language, click the links and dive deeper into this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.