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

FA> int a = 10,b = 99,c = 109;
FA> char ch1 = '+',ch2 = '=';
FA> char *text = "The sum of";

FA> printf("%s",func(text,a,ch1,b,ch2,c3,NULL);

FA> and then func() would peel off the pointers one by one, and perform some 
FA> magic so it could find the length of and type of it, convert it to string 
FA> if necessary,cat it to retstr and then some more magic finding and fetching 
FA> the next one until it finds a NULL. 

Ok, I see what you want to do, and no, you can't do that in C, and
you probably can't do it in C++ either.  BTW, "NULL" = 0 usually,
so you wouldn't be able to tell the end anyway.

FA> This came on while i was using Visual Basic last weekend, and there
FA> you could have :  mainstr = str1 + dec + long + str2 + single etc...all in 
FA> the same sentence.

Well sprintf() will do that for you, but of course you have to 
specify the format string.  And zcalc probably has code in there
to evaluate an expression, too.  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™.