My program contains a variable which is created locally but which I want to use in another function, is there anyway I can do this?
951
Using global variables in a function
113603
Declare local variables as late as possible or at the nearest curly brace they belong?
129423
How to change a global variable from within a function?
151869
What's the scope of a variable initialized in an if statement?
108473
How to access a function inside a function?
4588
Put local variables for Block in a variable
61828
What is the Python equivalent of static variables inside a function?
41710
How can I refer to a variable using a string containing its name?
123288
Dynamically set local variable
37271
How to access variables defined and declared in one function in another function?
15790
Accessing variables with the same name at different scopes
130477
In C, how do I restrict the scope of a global variable to the file in which it's declared?
17877
Why are local variables not initialized in Java?
23015
How to name variables on the fly?
102032
how to pass variable arguments to another method?
21112
Is it possible to create variables at runtime in Java?
18084
How do I save a variable or function definition to a file?