TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Paul Edwards
date: 1996-04-21 15:10:12
subject: Function args

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 ?

No, you have to give the function some way of determining that 
yourself, by the use of a format string in the case of printf().

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 doing it.
FA> If there is, how would i then check for the type ?

What are you really trying to do anyway?  C++ has function overloading,
if you want to go that route.  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™.