Register and join over 40,000 other developers!
Recent Topics
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
Delete account
pindo - Jul 23 2020 01:33 AM
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

Regarding A Function Accepting Variable Number Of Arguments In C
Started by csepraveenkumar, Jun 01 2012 08:56 AM
form
2 replies to this topic
#1
Posted 01 June 2012 - 08:56 AM
When we use va_list in function in c to make it accept a variable number of arguments , the first argument that we give which starts the list of arguments invariable in one form or another specifies the number or the type or both things about the arguments that are going to follow. Isn't there any way in which we don't have to specify this information before hand?
#2
Posted 01 June 2012 - 09:24 AM
No -- there is no way. We have to have at-least one argument (but can be more than one) before the 3 dots. The second argument to va_start macro must be the argument before the variable arguments. Again, the arguments before the 3 dots can be of any type. There is not relation between the types of variable number of arguments and the immediate before argument to the variable arguments. The macro uses that argument just to determine where to start from for the variable number of arguments.
#3
Posted 20 June 2012 - 09:55 AM
For any given call of the variable argument function, it must find out somehow how many arguments it has been given. If your arguments are going to mark the end, rather than the beginning of the list, try this:
#define foo(...) foo_internal(0,__VA_ARGS__); foo_internal(int dummy,...);Be very careful.
Also tagged with one or more of these keywords: form
General Forums →
General Programming →
Specifying PHP file path while creating an HTML formStarted by gvvishwanath, 30 Dec 2015 ![]() |
|
![]() |
||
Language Forums →
HTML, CSS and Javascript →
Jquery Validation in Partial View Form Isn't TriggeringStarted by googaplex, 01 Jul 2015 ![]() |
|
![]() |
||
Language Forums →
HTML, CSS and Javascript →
how to deal with the forms indtified with idStarted by scseguanshui06, 20 Jul 2014 ![]() |
|
![]() |
||
Language Forums →
PHP →
what script do I run on a form?Started by kxx4, 12 May 2014 ![]() |
|
![]() |
||
Language Forums →
Visual Basic →
Send multipart form data. (Send strings and a file)Started by LegacyDash, 21 Feb 2014 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download