Keil Logo

va_list

The va_list array type is defined in stdarg.h. This type holds data required by the va_arg and va_end routines. The va_list type is defined as:

typedef char *va_list;

and is used as shown in the following example:

#include <stdarg.h>

int varfunc (char *buf, int id, ...) {
  va_list tag;

  va_start (tag, id);

  if (id == 0) {
    int arg1;
    char *arg2;
    long arg3;

    arg1 = va_arg (tag, int);
    arg2 = va_arg (tag, char *);
    arg3 = va_arg (tag, long);
  }

  else {
    char *arg1;
    char *arg2;
    long arg3;

    arg1 = va_arg (tag, char *);
    arg2 = va_arg (tag, char *);
    arg3 = va_arg (tag, long);
  }

  va_end (tag);
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.