In the world of assembler language, when you call printf(), you do:
push arg_N
push arg_N-1
..
push arg1
push format
call _printf
But how does printf() here know how many arguments are passed in?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It just walks along the string, consuming parameters as it finds %-format items. If there are less arguments than %-items, then something awful happens.