Extra Paramaters

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 379
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is online now Online
Posting Whiz

Extra Paramaters

 
0
  #1
Oct 26th, 2009
How do I access the paramaters entered after param1?

Like this:

void foo(param1, ...);

How do I access the ... part?
...
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 16
Reputation: MasterDucky is an unknown quantity at this point 
Solved Threads: 0
MasterDucky MasterDucky is offline Offline
Newbie Poster
 
0
  #2
Oct 26th, 2009
Why do you wanna access it?

You pass parameters to functions, you dont access them.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 379
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is online now Online
Posting Whiz
 
0
  #3
Oct 26th, 2009
What?
This is what I wanna do:

  1. void print_something(const char *val, ...)
  2. {
  3. //the val part can have things like this in it:
  4. //%1, %2 and so forth, and then those parts get replaced by the paramaters after that.. so I wanna know how to get them.
  5. }
...
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,413
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 248
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c
 
0
  #4
Oct 26th, 2009
Last edited by Dave Sinkula; Oct 26th, 2009 at 1:16 pm.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC