Computer Science, asked by naveentadela9848, 1 year ago

Write a C program using External storage classes?


c programming​

Answers

Answered by Anonymous
1

Answer:Extern storage class

Extern stands for external storage class. Extern storage class is used when we have global functions or variables which are shared between two or more files.

Keyword extern is used to declaring a global variable or function in another file to provide the reference of variable or function which have been already defined in the original file.

The variables defined using an extern keyword are called as global variables. These variables are accessible throughout the program. Notice that the extern variable cannot be initialized it has already been defined in the original file

Example, extern void display();

First File: main.c

#include <stdio.h>

extern i;

main() {

printf("value of the external integer is = %d\n", i);

return 0;}

Second File: original.c

#include <stdio.h>

i=48;

Explanation:

Hope it helps you

Similar questions