Possible Duplicate:
What is the signature of printf?
I know that there will be an argument list for every function.
if we pass the arguments more than no.of variables mentioned in the argument list then
it gives an error.but my question is
Printf() function also has argument list and eventhough we give ‘n’ no.of arguments the
printf() function doesnt fails then
i want to know wht will be used in argument list section of printf() which takes infinate argument list?
printf’s signature looks something like this:
If a function has a ‘…’ as its last argument, it can receive any number of arguments. Within the function, you would use va_arg to access those arguments. Here is an example from cplusplus.com:
Notice that PrintFloats here requires that you pass in the number of additional arguments. printf doesn’t need to do this, because it can infer how many arguments you are passing in by counting the tags in the format string.