473,473 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

passing infinite number of arguments to a funcion in C

9 New Member
Hello guys,

i want to pass infinite number of arguments to a function and print all of them how can i do it in c.

example:

main(void)
{
foo(1,2,3,"welcome","hi","how are you");
return 0;
}

i do know that foo() empty brace would accept infinite number of arguments but how to extract them one by one and use them
Sep 18 '07 #1
4 3767
Ganon11
3,652 Recognized Expert Specialist
Check out this article and the ones related to it.
Sep 18 '07 #2
mohammadthalif
9 New Member
Check out this article and the ones related to it.
the link give seems to be suitable for c++. will this work on C?
Sep 18 '07 #3
gpraghuram
1,275 Recognized Expert Top Contributor
the link give seems to be suitable for c++. will this work on C?
Hi,
Look the following example available in the link provided by Ganon.
If you wuld have read it fully you culd have understood the code.
Thanks
Raghuram
Sep 18 '07 #4
mohammadthalif
9 New Member
This is what i want..
Thank you guys for your kind reply..
Sep 18 '07 #5

Sign in to post your reply or Sign up for a free account.

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) {...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
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: Charles Sullivan | last post by:
The library function 'qsort' is declared thus: void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); If in my code I write: int cmp_fcn(...); int...
3
by: Mantorok | last post by:
Hi all I'm pretty new to ASP.Net, is it possible to pass arguments (maybe objects too) to web forms without using a querystring in the URL? Thanks Kev
6
by: Max | last post by:
Last time I tried to explain this on another forum it didn't go too well, so I'll try my best and if you know what I'm talking about then please tell me how to do this. I have a class, inside I...
2
by: Colmag | last post by:
I'm running a console application (ghostscript) by starting it as a process with arguments. The problem i'm having is that it's falling over when I pass a file containing spaces in the filename...
9
by: oldyork90 | last post by:
I'm going thru code and have never seen this before http://www.webreference.com/programming/javascript/mk/column2/3.html Look at function CreateDragContainer() on line 25. It has no arguments...
5
EntryTeam
by: EntryTeam | last post by:
Hello. I'm trying to figure out the best way of communication between two classes: MainForm.cs ServiceChild.cs (1) Now I have ServiceChild.MyMethod() which gets around 10 arguments using...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.