answersLogoWhite

0

What does printf function return?

Updated: 12/10/2022
User Avatar

Wiki User

13y ago

Best Answer

Two possibilities: on success, it'll return the amount of characters printed. On failure, a negative number is returned.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does printf function return?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you use printf as a return value?

No, it is a function. But printf does return a value: the number of characters it has written.


How you write a c program for making a call in gcc?

int main() { // Call the printf function printf("This is a function call!\n"); return 0; }


How do you call a function from another file?

Via its name, like: int main (void) { printf ("I'm calling printf right now\n"); return 0; }


What is printf function?

Printf function is used in c language. Printf is used to print something to the standard output. ex: printf ('welcome');


What is the function and syntax of printf statement?

it's not a statement, it's a function: len= printf (format, ...more-parameters...);


What is the difference between echo and print and printf in PHP?

The print function is slightly more dynamic than the echo function by returning a value, and the echo function is slightly (very slightly) faster. The printf function inserts dynamic variables/whatever into wherever you want with special delimiters, such as %s, or %d. For example, printf('There is a difference between %s and %s', 'good', 'evil') would return 'There is a difference between good and evil'.


Calculate length of string using printf statement only?

printf does return the length: size_t len = printf ("%s", str);


What is the prototype of printf function?

in stdio.h:extern int printf (const char *fmt, ...);


Is printf keyword?

== == What is printf in c or prototype of printf with example (q) What is prototype of printf function ? Explain each term. Ans: Prototype of printf function is : int printf( const char *format ,…) Explanation of each term : Parameter of printf function is : (three continuous dots) : It is called ellipsis. It indicates the variable number of arguments. Example of ellipsis: #include void ellipsis(int a,...); void main() { int a=5,b=10; clrscr(); ellipsis(a,b); getch(); } void ellipsis(int a,...) { printf("%d ",a); } Output:5 So printf function can have any number of variables as an argument.


Why printf is used instead of print in c?

The printf() function prints a formatted string.


What is the type of printf statement in C?

It is a function.


Where the printf statements are stored in memory?

Try this: #include <stdio.h> int main (void) { printf ("printf is at location %p\n", (void *)printf); printf ("main is at location %p\n", (void *)main); return 0; }