Variable length parameter lists
I know how to declare:
MyFunc(int a, ...)
If I called this function like this:
int x=10;
int y=8;
MyFunc(x, y);
How can I obtain the value for y inside the function?
-------------Ban KalvinB !
An example from the MSDN:
Basically, make a va_list, call va_start and pass it the list name and the name of the variable(in your case ''a''), and then call va_arg until it returns -1. Then call va_end to finish up.
|
Basically, make a va_list, call va_start and pass it the list name and the name of the variable(in your case ''a''), and then call va_arg until it returns -1. Then call va_end to finish up.
![](smile.gif)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement