Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How printf function work in C?

user-image
Question ajoutée par Gaurav Kumar
Date de publication: 2014/09/24
Abdul Khader Shaik
par Abdul Khader Shaik , Cyber Crime Lawyer , Grofers

Printf is a variable length argument (as it take multiple arguments).User supply a string and input argumnets. Printf creates an internal buffer for constructing output string. Now printf iterates through each characters of user string and copies the character to the output string. Printf only stops at "%". "%" means there is an argument to convert. Arguments are in the form of char, int, long, float, double or string. It converts it to string and appends to output buffer. If the argument is string then it does a string copy. Finally printf may reach at the end of user sting and it copies the entire buffer to the stdout file.

 

Source:source:

Shafat Ahmad
par Shafat Ahmad , Trainer , Multichannel Educational Institute

the function printf() returns the number of characters printed on the console!

why there are some space between heap and stack section of memory?

Amirtha Lakshmi
par Amirtha Lakshmi , Teacher , Sivakasi Institute chartered accountants of india

It is used to display whatever the text within double quotes

More Questions Like This