question on function arguments and parameter passing

X

xideum

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.
 
E

Eric Sosman

xideum said:
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.
 
A

Alan Balmer

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,427
Latest member
HildredDic

Latest Threads

Top