J
Joona I Palaste
Ganesh Kundapur said:Hi all,
struct test {
static int x;
}X;
main()
{
X.x = 100;
}
When i compile this code, i get fallowing errors
----------------------------------------------------
x.c:2: parse error before "static"
x.c:2: warning: no semicolon at end of struct or union
x.c:3: warning: data definition has no type or storage class
x.c: In function `main':
x.c:7: request for member `x' in something not a structure or union
-------------------------------------------------------
If i remove static, it works fine. Can someone explain me what happerns
if i declare the structure member as static.
First tell us what it would *MEAN* for a structure member to be static.
--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Hasta la Vista, Abie!"
- Bart Simpson