Pass va_list or pointer to va_list?

前端 未结 6 1091
遇见更好的自我
遇见更好的自我 2020-12-01 12:22

Suppose I have a function which takes variadic arguments (...) or a va_list passed from another such function. The main logic is in this function i

6条回答
  •  我在风中等你
    2020-12-01 12:55

    In my understanding, you're supposed to pass the va_list directly (not a pointer to it). This seems to be supported by comp.lang.c:

    "A va_list is not itself a variable argument list; it's really sort of a pointer to one. That is, a function which accepts a va_list is not itself varargs, nor vice versa. "

提交回复
热议问题