Results 1 to 3 of 3
Hi all,
I have come across a code in which a static variabe is declared as
int static i;
Now the compiler gives a warning that : "Storage class defined ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-24-2005 #1Just Joined!
- Join Date
- Aug 2005
- Location
- India
- Posts
- 5
Is there any difference between "int static i" and "static int i"
Hi all,
I have come across a code in which a static variabe is declared as
int static i;
Now the compiler gives a warning that : "Storage class defined before acess specifier".
So is there any differrence between
int static i; and
static int i;
- 08-24-2005 #2
Yes, the difference is that one is right and one is wrong. The compiler can handle it (hence the warning not the error), but in general the storage class should come first.
static int i;
or even
static const char * const str;
Linux user #126863 - see http://linuxcounter.net/
- 08-30-2005 #3Just Joined!
- Join Date
- Aug 2005
- Location
- India
- Posts
- 5
Thanks for the answer.


Reply With Quote
