Skip to content
Discussion options

You must be logged in to vote

This is using a special system in C called variadic arguments. You can see it in the code here where the ... invokes it.

FormatString(umw DestSize, char* Dest, char* Format, ...)

that ... means this function may take more arguments and at compile time, we do not know how many or what type these argument(s) are AOT (ahead of time).

In order to handle those variadic arguments, C macros are used that come from <stdarg,h>.
Those macros are:

  1. va_list: a special type that represents the list of the extra arguments that are passed in.
  2. va_start: this initializes va_list -- specifically clarifying where it begins.
  3. va_arg: this pulls out the next argument and its type from the list.
  4. va_end: this cl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btgvesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants