一个初学者的问题
#include <stdio.h>
void main()
{
printf( "hello world\n ");
return;
}
请问大家,不定参数是在底层怎么实现的
函数返回为什么要用return ; 而不是花括号结束
[解决办法]
printf的源代码
不定参数,函数声明用...
int printf (
const char *format,
...
)
/*
* stdout 'PRINT ', 'F 'ormatted
*/
{
va_list arglist;
int buffing;
int retval;
va_start(arglist, format);
_ASSERTE(format != NULL);
_lock_str2(1, stdout);
buffing = _stbuf(stdout);
retval = _output(stdout,format,arglist);
_ftbuf(buffing, stdout);
_unlock_str2(1, stdout);
return(retval);
}