Or it would possibly cause a segfault, since A can only be legally indexed
by 0..9. (This is assuming it didn't get optimized out).
Sometimes, you need to specify the address or pointers to addresses of
hardware registers as 'volatile', so that the compiler does not optimize
them out of doing what you expect.
And yes, seeing all the code is important. Otherwise, it's just pure
speculation.
--John
-----Original Message-----
From: owner-classiccmp(a)classiccmp.org
[mailto:owner-classiccmp@classiccmp.org]On Behalf Of Fred Cisin
(XenoSoft)
Sent: Wednesday, February 06, 2002 13:21 PM
To: classiccmp(a)classiccmp.org
Subject: The importance of showing ALL of the code in C
an example:
int A[10];
int N;
N = 3;
A[10] = 2;
printf("%d",N);
In many other languages, A[10] = 2 would not have any effect on N.