* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / unproto / varargs.c
blob4ca56d8155449eefd2cb32cf5991ad5f7300d089
1 /*
2 * @(#) varargs.c 1.1 91/09/01 23:08:45
3 *
4 * This program can be used to verify that the stdarg.h file is set up
5 * correctly for your system. If it works, it should print one line with the
6 * text "stdarg.h works".
7 */
9 #include <stdio.h>
10 #include "stdarg.h"
12 main(int argc, char *argv[])
14 varargs_test("%s %s\n", "stdarg.h", "works");
17 varargs_test(char *fmt, ...)
19 va_list ap;
21 va_start(ap, fmt);
22 while (*fmt) {
23 if (strncmp("%s", fmt, 2) == 0) {
24 fputs(va_arg(ap, char *), stdout);
25 fmt += 2;
26 } else {
27 putchar(*fmt);
28 fmt++;
31 va_end(ap);