So I'm pretty new to programming. Maybe this is a dumb question but is there a way to avoid global variables when using stuff that requires callback functions?
Since the variable needs to be accessible int two different functions, one which I am unable to change the arguments. I don't see how it's possible
It depends on situation.But memory should not be problem for beginners.
As for beginner programming you can use refenences.
pass variables in function parameter by reference.