TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Paul Edwards
date: 1996-04-28 00:44:04
subject: Function args

dn> To simplify the previous example, you could use a "magic
string" of some 
dn> sort, such as that used by *printf(). Or make it simpler again, and say 
dn> that as many args are passed as there are characters in the char array 
dn> pointed to by the first argument, that an 'i' character means an int, a 'd' 
dn> character means a double, a 's' means a char* and so on. So you'd be 
dn> looking at something like:

dn> void foo(char const *fmt, ...)
dn> {
dn>   va_arg arp;
dn>   va_start(argp,fmt);
dn>   while (*fmt)
dn>   {
dn>     switch (*fmt++)
dn>     {
dn>     case 'i':
dn>         {
dn>             int i = va_arg(argp,int);
dn>             /* ... */
dn>         }
dn>         break;
dn>     case 's':
dn>     /* and so on... */
dn>     }

Code to do this sort of think can be obtained by FREQing "TFON*.*"
from 3:711/934.  BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.