local to global variable
in
Programming Questions
•
1 years ago
hi,
onother beginers question.
What is way to make local variable to global, o simply visible to the other methods.
In this example I want to print variable
c in method
ex_1, what is solution ?
thanks in advice
- int a = 1;
- void setup()
- {
- ex_1();
- ex_2();
- }
- void ex_1() {
- int b = 1;
- println(c);//error
- }
- void ex_2() {
- int c = 2;
- println(c);
- }
1