+ 2
Variable scope
what is example of local variable??
2 Answers
+ 6
Any variable inside a block of code is local to that block.
Blocks of code are loops, functions, classes, ...
0
#include<stdio.h>
int max=10;
void main()
{
int d=34;
}
in this c++ code max is global variable & d is local variable.
local variabl is only for {} this scop out side this scop it can not use.
try your salf.