|
发表于 2005-7-25 22:03:31
|
显示全部楼层
[code:1]
#include <stdio.h>
#include <stdarg.h>
void test ( char *str,...)
{
int i;
va_list ap;
va_start(ap,str);
printf("%s\n",str);
while((i=va_arg(ap,int)))
printf("%d\n",i);
va_end(ap);
}
main()
{
test("hello",1,2,3,4,5,6,NULL);
test("hi",11,22,33,44,NULL);
}
[/code:1] |
|