What is the difference between local and global (extern) variables?
Describe situations in which you would use each type of variable.
Why do most programmers try to avoid using global variables?
>>55883454
Seriously. Are you in high school, anon?
Global variables are accessible globally, or in any scope in the program.
You use local variables when you want to store something, you never use global variables (though sometimes i use them for ease when i'm just writing a quick and stupid script)
Avoid global variables because they encourage bad software design. You should pass variables as parameters. This will make the flow of data and the use of variables more clear to someone reading your code.
>>55883454
It's stupid not to exclusively use global variables that standard started because of the increased amounts of females going into computer courses that couldn't handle the experience and knowledge to do so.
>>55883528
Way to spoon feed faggot OP, anon.
Now every CS 101 fag will come here and have everyone do their homework for them.
>>55883528
Don't listen to this retard, always use global variables; it's easier to read if you have a single global variable instead of ten local variables that different functions pass to each other as parameters.
>>55883552
im a minority muslim u should do my homework
>>55883552
if he uses these answers he will get a zero don't worry anon!
>>55883605
how u know that m8 ?
>>55883605
are they bad answers ?
>>55883727
they're probably not what your teacher is looking for
read your book kiddo
global variables have been to every continent of the program and can have values in many different languages.
local variables do basic work and are less sophisticated.