A variable declared in the body of a function is said to be ________ to the func
ID: 3582025 • Letter: A
Question
A variable declared in the body of a function is said to be ________ to the function. Storage for a ________ variable is automatically allocated when the function is called and ________ when the function returns. The ________ of a variable is the portion of the code in which the variable can be referenced. Putting the keyword ________ in the declaration of a local variable causes it to have permanent storage location, so it retains its value throughout the life of the whole program. ________ have the same properties as local variables, except that the value is initialized automatically each time the function is called, by being assigned the values of the arguments in the call. ________ or ________ variables have static storage duration, and are or visible and useable to all functions following their physical declaration. ________ or ________ variables, while syntactically allowable, are not acceptable in this course, and not allowed in almost every other business environment. The storage duration and visibility of a variable declared inside a ________ statement or ________ is limited to the block. Declaring identically named variables inside and outside of a ________ is syntactically acceptable, but can be VERY confusing and make maintenance of the code difficult. Every function, except main, should be ________ or ________ prior to its first call.Explanation / Answer
1) A variable declared in body of a function is said to be local to the function. As the scope of that variable will be within function only.
2) Storage of a local variable (which is refered to as auto type when considered storage) is automatically allocated when the function is called and destroyed when function returns.
4) Putting keyword static in declaration of local variable cuses it to have permanent storage location , and it retains its value throughout life of whole program.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.