Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
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:
the function printf() returns the number of characters printed on the console!
why there are some space between heap and stack section of memory?
It is used to display whatever the text within double quotes