Compare and Contrast Local and Global variables. Where are they declared? Who can see and use them? Which ones are generally easier to use and why? Why wouldn't you want to make all your variables global?
Local and global variabal but are used for different things. The difference is where they are declared. Local variables go under main and only the code under main can use them. Global goes above main and all the variables can use it. I would say global variables are easier to use.
No comments:
Post a Comment