How to count the number of arguments passed to a function that accepts a variable number of arguments?

前端 未结 10 2170
旧时难觅i
旧时难觅i 2020-12-01 05:18

How to count the no of arguments passed to the function in following program:

#include
#include
void varfun(int i, ...);
int m         


        
10条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 05:37

    You can't. Something else has to tell you (for instance for printf, it's implied by the number of % format descriptors in the format string)

提交回复
热议问题