J
Jon
Is it possible to modify an argument of a va_list and then pass the
modified va_list to other functions?
void c_fun1(int, va_list args)
{
int *firstIntPointer = &(va_arg(args, int));
*firstIntPointer = 2; // a new value
}
void c_fun(int v, va_list args)
{
c_fun1(v, args);
c_fun2(v, args); // c_fun2 expects the modified int
}
It seems that Windows/Hp/SOlaris/AIX all work, but Linux is giving g++
compiler errors.
error: non-lvalue in unary `&'
Thank you.
Jon
modified va_list to other functions?
void c_fun1(int, va_list args)
{
int *firstIntPointer = &(va_arg(args, int));
*firstIntPointer = 2; // a new value
}
void c_fun(int v, va_list args)
{
c_fun1(v, args);
c_fun2(v, args); // c_fun2 expects the modified int
}
It seems that Windows/Hp/SOlaris/AIX all work, but Linux is giving g++
compiler errors.
error: non-lvalue in unary `&'
Thank you.
Jon