ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How printf function work in C?

user-image
تم إضافة السؤال من قبل Gaurav Kumar
تاريخ النشر: 2014/09/24
Abdul Khader Shaik
من قبل 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
من قبل Shafat Ahmad , Trainer , Multichannel Educational Institute

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

Gaurav Kumar
من قبل Gaurav Kumar

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

Amirtha Lakshmi
من قبل Amirtha Lakshmi , Teacher , Sivakasi Institute chartered accountants of india

It is used to display whatever the text within double quotes

المزيد من الأسئلة المماثلة