By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,763 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,763 IT Pros & Developers. It's quick & easy.

question on function arguments and parameter passing

P: n/a
Hi. Question: In a function that takes multiple arguments, each with a
default value set[EX: void blah(int one=1, int two=2, int three=3);]is
there anyway to either alter the order of the parameters you pass to it
or skip the passing of certain parameters[sort of like(if I wanted to
let "two" take on the default): blah(12, three=53); or blah(12,,53); or
blah(12,default,53);]?

I'm mainly asking because lately I've had to do some gui programming,
calling a widget function that takes like 80 defaulted arguments, with
only a single one I want to alter, makes me hate life.

Sorry if there's recently been a similar post.

Thanks.

Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


xideum wrote:
Hi. Question: In a function that takes multiple arguments, each with a
default value set[EX: void blah(int one=1, int two=2, int three=3);]


This isn't C; C's function arguments do not have
default values. You must be thinking of some other
programming language.

--
Er*********@sun.com

Nov 14 '05 #2

P: n/a
On 24 Mar 2005 07:01:24 -0800, "xideum" <xi****@gmail.com> wrote:
Hi. Question: In a function that takes multiple arguments, each with a
default value set[EX: void blah(int one=1, int two=2, int three=3);]is
there anyway to either alter the order of the parameters you pass to it
or skip the passing of certain parameters[sort of like(if I wanted to
let "two" take on the default): blah(12, three=53); or blah(12,,53); or
blah(12,default,53);]?

I'm mainly asking because lately I've had to do some gui programming,
calling a widget function that takes like 80 defaulted arguments, with
only a single one I want to alter, makes me hate life.

Sorry if there's recently been a similar post.

You should ask in a group which deals with your programming language
(which is obviously not C, the language this group deals with). Have
you considered writing a wrapper function which takes your one
argument and expands it to a call with all 80 arguments?

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.