What are Storage Classes in C ?
Answer Posted / veda
example of global variable----
#include<stdio.h>
int a; /***global variable*********/
void main()
{
int s;
printf("\n enter the value of a--");
scanf("%d",&a);
s=a+3;
printf("\n s=%d",a);
mul(); /****another function********/
getch();
void mul()
{
int m;
m=a*2;
printf("\n m=%d",a);
}
output---
enter the value of a----5
s=8
m=10
when u r compaing this program in lnux we get a waring
because in linux default type is integer so in calling
function we r giving void so internally compailer treate as
a int so,
here type declaration is impartent
| Is This Answer Correct ? | 21 Yes | 25 No |
Post New Answer View All Answers
What is scope rule in c?
What is a MAC Address?
Multiply an Integer Number by 2 Without Using Multiplication Operator
how to print the character with maximum occurence and print that number of occurence too in a string given ?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is the difference between malloc() and calloc() function in c language?
How does normalization of huge pointer works?
What are the __date__ and __time__ preprocessor commands?
Why c is called object oriented language?
What is clrscr in c?
How many header files are in c?
What is f'n in math?
ATM machine and railway reservation class/object diagram
What are the advantages of the functions?
Explain how can you tell whether a program was compiled using c versus c++?