Can anyone give me example of multiple arguments function?
Discuss Can anyone give me example of multiple arguments function? in the C Programming forum on Dev Shed. Can anyone give me example of multiple arguments function? C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
Location: Central New York. Texan via Arizona, out of his element!
Posts: 8,515
Time spent in forums: 4 Weeks 18 h 59 m 31 sec
Warnings Level: 20
Number of bans: 3
Reputation Power: 3268
Look up "variadic functions." (varargs)
__________________
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it. DaWei on PointersPolitically Incorrect.
Posts: 3
Time spent in forums: 11 m 18 sec
Reputation Power: 0
Solution for Turboc3 Compiler?
I want solution for Turboc3 Compiler?
I tried putting void display(int x,...);
it accepts ... means there would be some solution.?
Can you post example for turboc?
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,402
Time spent in forums: 2 Months 8 h 53 m 6 sec
Reputation Power: 4080
Dawei posted a perfectly good answer which works for TurboC 3 as well (I know it worked in TurboC 2.0 for sure). Have you tried googling for those terms + example.
Also, just so you know, TurboC compiler is outdated and you shouldn't be using it. Tell your teacher I said so.
__________________ Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
Though you should have been able to find that in your textbook. And in the documentation for the standard library functions.
Of course, those are function prototypes which only need to know what datatype each parameter is. When you write the function itself, you will need to give each parameter a name in addition to the datatype.
Posts: 3
Time spent in forums: 11 m 18 sec
Reputation Power: 0
I am talking with respect to int printf (const char*, ...);
Also I was looking for its implementation. If I could find it may be i could easily understand how it works & I could write my display function.