I have 2 files in one folder. In file "X" i use variables from file "Y" with "Y." successfully. But i now would like to use arrays and variables generated in function "A" inside file "X", in function "B", still inside file "X".
I tried similar formats to "Y." and nothing seems to yield success. I would really like to avoid forcing function "A" to return all these arrays and variables, then pass them all through function "B"'s parameters.
EDIT:
This is my first post and i can't seem to vote or comment on anyone's responses- thank you for the help, i'm sorry my question was sub-par, i tried to be specific. I don't see a way i could clear anything up by typing code, there's quite a lot of it.
My question was essentially answered.
I am told that i cannot use or alter a variable outside of the function it was created in. I wanted to do this with something similar to the method i know works between files. I am currently using the format
<fileY>.<variableinfileY>
to access file Y's variable in this new file X. I thought that if i could do that, then i could use a similar method to access variables in other functions within the same file, but oddly enough it's not possible.
For anyone curious, one form which may solve a similar issue is
Arrays.copyOf(<arrayname>, <arrayname>.lengh)
, but for me this does not help, and i must return variables in one funcion and pass the variables through the new function as parameters.
EDIT EDIT:
You guys really want code :) haha
<afunctionname>{
char[][] thisarray = new char[cols][rows];
}
<DIFFERENTfunctionname>{
<this is where i want to use thisarray>
}