| #include <stdio.h> | |
| #include <stdarg.h> | |
| void testVaCopyArg(char *fmt, ...) { | |
| va_list ap, aq; | |
| char *s; | |
| va_start(ap, fmt); | |
| va_copy(aq, ap); /* test va_copy */ | |
| s = va_arg(aq, char *); | |
| printf("string %s\n", s); | |
| } | |
| int main() { | |
| testVaCopyArg("s", "abc"); | |
| return 0; | |
| } |