https://linen.dev logo
How can use a variable inside a function to point ...
# programming
t
How can use a variable inside a function to point to an argument
labelList
and then use that variable to modify to the original list? Something like this, although this is not compiling
Copy code
int foo(const int i, labelList& x1, labelList& x2)
{
    labelList x;
    if (i == 0)
        x = & x1;
    else
        x = & x2;
    x[0] = 1;
}