KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Suppose I have a function which takes variadic arguments ( ... ) or a va_list passed from another such function. The main logic is in this function itself (let's call it f1 ), but I want to have it pass the va_list to another function (let's call it f2 ) which will determine the next argument type, obtain it using va_arg , and properly convert and store it for the caller to use. Is it sufficient to pass a va_list to f2 , or is it necessary to pass a pointer to va_list. Unless va_list is required to be an array type or else store its position data at the location the va_list object points to (rather than in the object itself), I can't see how passing it by value could allow the calling function ( f1 ) to 'see' the changes the called function made by va_arg . Can anyone shed light on this? I'm interested in what the standard requires, not what some particular implementation allows.
Tags (comma-separated)
Save Edits
Cancel