stdarg.3 (c1f3e4bf21571a88d4269a87f57e3e4ff2ba3ef6) stdarg.3 (cc0235828a963095fa28012ce8d4124b8447f762)
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information
6.\" Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 136 unchanged lines hidden (view full) ---

145.Em foo
146takes a string of format characters and prints out the argument
147associated with each format character based on the type.
148.Bd -literal -offset indent
149void foo(char *fmt, ...)
150{
151 va_list ap;
152 int d;
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information
6.\" Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 136 unchanged lines hidden (view full) ---

145.Em foo
146takes a string of format characters and prints out the argument
147associated with each format character based on the type.
148.Bd -literal -offset indent
149void foo(char *fmt, ...)
150{
151 va_list ap;
152 int d;
153 char c, *p, *s;
153 char c, *s;
154
155 va_start(ap, fmt);
156 while (*fmt)
157 switch(*fmt++) {
158 case 's': /* string */
159 s = va_arg(ap, char *);
160 printf("string %s\en", s);
161 break;

--- 46 unchanged lines hidden ---
154
155 va_start(ap, fmt);
156 while (*fmt)
157 switch(*fmt++) {
158 case 's': /* string */
159 s = va_arg(ap, char *);
160 printf("string %s\en", s);
161 break;

--- 46 unchanged lines hidden ---