Practice Problem 12
Basics
Question 1-1
What do you call a variable that can only be used within a specific function?
Question 1-2
What do we call variables that can be used throughout an entire source file?
Question 1-3
What do you call a variable that can only be used within a specific function but retains its value?
Program reading
From the following program, local variables, global variables, and static local variables,
Extract them individually.
Extract them individually.
Question 2-1
#include <stdio.h>
int var;
int main(void)
{
int count;
static int arc;
return 0;
}
explanatory
Question 3-1
Variables are generally created independently for each function.Explain it concisely.
Fundamentals (Answer Key)
Solution 1-1
Local variable
Solution 1-2
Global variable
Solution 1-3
Static Local Variable
Program Reading (Solution Example)
Solution 2-1
Local variable : count
Global variable : var
Static Local Variable : arc
Global variable : var
Static Local Variable : arc
descriptive (answer)
Solution 3-1
To enable variable names to be chosen without having to check each time whether they conflict with other functions.
About This Site
Learning C language through suffering (Kushi C) isThis is the definitive introduction to the C language.
It systematically explains the basic functions of the C language.
The quality is equal to or higher than commercially available books.




