C language learned by suffering
C language learned by suffering
Exercise 12
fundamental knowledge
Q1-1
What do you call a variable that can only be used within a specific function?
Q 1-2
What do you call a variable that can be used throughout a source file?
Q1-3
What do we call a variable that can only be used within a specific function but whose value remains?
program read-only
From the following program, you will see that local variables, global variables, static local variables, and
out of each.
out of each.
Q2-1
#include <stdio.h>
int var;
int main(void)
{
int count;
static int arc;
return 0;
}
descriptive expression
Q3-1
In principle, variables are created independently for each function, but briefly explain why this is so.
Basic Knowledge (sample answers)
Solution 1-1
local variable
Solution 1-2
g
Solution 1-3
Static local variables
Program reading (example solution)
Solution 2-1
Local variable : count
Global variables : var
Static local variable : arc
Global variables : var
Static local variable : arc
Short Answer Type (Sample Answers)
Solution 3-1
The name of the variable must be the same as the name of another function.
To be able to name variables without having to check each and every one of them.
To be able to name variables without having to check each and every one of them.
About this Site
The C language (bitter C), which is learned by suffering, is
This is the definitive C language introductory site.
It systematically explains the basic functions of the C language and
It is as complete as or more complete than any book on the market.