LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write and use a function() with unknown parameters (... = ellipse)?

As I know function prototype for ellipse functiones are e.g. f(int count, long summ, ...).
But I do not know how to get the unknown count of parameter inside my function.

Regards
0 Kudos
Message 1 of 4
(3,182 Views)
Forelle,

I'm not sure I understand your question. Are you talking about how to return information from functions in C?

If so then this might help.

To return one value from a function do the following:

//Function Prototype
double f(long, double);

//Function call
value = f(count,summ);

//Function description
f(count,summ)
{
double amount=0.0;

amount = count * summ;

return amount;
}

To manipulate variables inside the function you need to use pointers. You can use references also I guess. Anyway, you could try something similar to what's in the included .txt file.

Grant
Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 2 of 4
(3,182 Views)
I suppose you're talking about functions that accept a variable list of arguments. If it's so, here you will find some useful hints and reference.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000EB2C0000&UCATEGORY_0=_46_%24_7_&UCATEGORY_S=0&USEARCHCONTEXT_TIER_0=0&USEARCHCONTEXT_TIER_S=0&USEARCHCONTEXT_QUESTION_0=variable+argument+list&USEARCHCONTEXT_QUESTION_S=0&RSESSION=101_4276:d4047b94005dc94a80a249ad:999597130962

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,182 Views)
I am sorry that I took you on the wrong path. I was talking about functions that accept a variable list of arguments.
See Roberto Bozzolos answer. He gave me a verry good hint.

Sincerely Forelle
0 Kudos
Message 4 of 4
(3,182 Views)