Keil Logo

va_end

Summary
#include <stdarg.h>

void va_end (
  argptr);      /* optional argument list */
Description

The va_end macro is used to terminate use of the variable-length argument list pointer argptr that was initialized using the va_start macro.

Return Value

None.

See Also

va_arg, va_start

Example
#include <stdarg.h>
#include <stdio.h> /* for printf */

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);
}

void caller (void) {
  char tmp_buffer [10];

  varfunc (tmp_buffer, 0, 27, "Test Code", 100L);
  varfunc (tmp_buffer, 1, "Test", "Code", 348L);
}
  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.