Skip to content

Pass by reference

I am trying to define a function where arguments are passed by reference. But csnake.Function class constructor does not accepts csnake.Dereference instance in arguments field. Is it even possible? Here is my example what I have in mind:

import csnake as cs

var = cs.Variable("question_number", "int")
var = cs.Dereference(var)

fun = cs.Function("ask_seleukos_I_nikator", "void", arguments = [ var ])

But I see an csnake.Dereference instance cannot be passed as a variable:

TypeError: variable must be one of (Variable, Collection, Mapping)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information