Hello i found that only register storage class is allowed in function.But it gives error when i mae it extern auto,extern static...
Hello i found that only register storage class is allowed in function.But it gives error when i mae it extern auto,extern static...
#include<stdio.h>
int sum( int ,int,int );
int main()
{
int a=5,b=2,c=20;
int d;
d=sum(a,b,c);
printf("c=%d",d);
}
int sum(static int a,register int b,extern int c)
{
return a+b+c;
}
int c=20;
it shows error: storage class specified for parameter āaā
storage class specified for parameter ācā
Also as we know that int a; whenn we write it is same as auto int a;
means auto is the default
#include<stdio.h>
int sum( int ,int,int );
int main()
{
int a=5,b=2,c=20;
int d;
d=sum(a,b,c);
printf("c=%d",d);
}
int sum(auto int a,auto int b,auto int c)
{
return a+b+c;
}
It also gives error !!!
please explain