+ 2
Can't use an assigned variable elsewhere.
Can someone please explain why x,y and z can't be used outside the functions? I tried declaring them outside the functions but then they can't be read IN the functions. What I don't get is why it doesn't show outside the function. I even tried using const but no difference. https://code.sololearn.com/WHM5APcD3Ivh/?ref=app
2 Respostas
+ 2
Avi Pheimei Konyak when I do that, I can't use them in the function.
0
Those x y and z variables are local variables, meaning they can be used only side the function in which they were created. You'll need to declare them outside the function to be able to use them