| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Function args |
Quoting Frank Adam to All
FA>Is it at all possible to send variable type and number of args to a
FA>function, and determine the types and number of them at runtime ?
FA>eg. void foo(char*,...);
FA>foo("hello",10,5.6,'o');
FA>foo(10.7,90,"Hello",'i',90,80);
FA>This may not make any sense, but i'm curious if there is a way of
FA>doing it. If there is, how would i then check for the type ?
I'd say there isn't, because otherwise the *printf functions wouldn't
need to use different placeholders for different types (ie %d, %s, etc).
... Lose not thy airspeed lest the ground rise up and smite thee!
--- FMailX 1.02
* Origin: Power BBS - +61-2-858-4114 - Files/Games/EchoMail/Internet (3:711/953)SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 808 809 932 934 946 SEEN-BY: 711/953 963 712/515 713/888 714/906 800/1 @PATH: 711/953 410 808 934 |
|
| 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™.