摘要:
#include stdarg.h#include stdio.hint sum(int num, int arg, ...); void main(){ int num=sum(5,1,2,3,4,5); printf("%d\n",num);}int sum(int num, int arg, ...){ int n,summary; va_list ap; if(num 1) return 0; n = num; va_start(ap, arg); /*init ap*/ summary = arg; while(--n 0) { summary += va_a 阅读全文