C is a block structured language. Blocks are enclosed by { and }. Blocks can be defined wherever a C statement could be used. No semi-colon is required after the closing brace of a block.
Variable Scope
refers to where variables is declared.
Global variables
Global variable are declared outside any functions, usually at top of program. they can be used by later blocks of code:
int g;
int main(void)
{
g = 0;
}
Local variables
Variables that are declared inside a function or block are local variables. The scope of local variables will be within the function only. These variables are declared within the function and can't be accessed outside the function.
void main()
{
int g;
g=2;
printf(''g= %d'',&g);
}
About goddem
Templatesyard is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates which are professionally designed and perfectlly seo optimized to deliver best result for your blog.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment