473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

question on function arguments and parameter passing

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
2 1409


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
17
by: pratik | last post by:
i am working a turbo c; the code i typed in is as follows #include<stdio.h> main() { int a=5; printf("%d%d%d",a++,++a,a); } The output of the above code is very interesting. can anyone help...
5
by: Martin Johansen | last post by:
Hello C programmers If I have a function, say void f(int a, char b); And I call this function with the following arguments char a; int b;
6
by: enjoying the view | last post by:
I am working on a school project, trying to build a simple RPC stub generator. The idea is that the generator takes a normal python file with functions defined in it and produces a client and...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
10
by: Janus | last post by:
Hi, Is there a way to pass arguments to the callback function used inside an addEventListener? I see that I can only list the name of the callback function. For eg, I use this: var...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.