32 day
1. Global Scope in C
The global scope refers to the region outside any block or function.
The variables declared in the global scope are called global variables.
Global variables are visible in every part of the program.
Global is also called File Scope as the scope of an identifier starts at the beginning of the file and ends at the end of the file.
// filename: file1.c
#include <stdio.h>
// Define the global variable
int a;
// Define the function to use the global variable
void myfun()
{
printf("%d\n", a);
}
Comments
Post a Comment