Posted by: testdirector August 3, 2005
Information technology
Login in to Rate this Post:     0       ?        
what about using const operator. #include const int array[] = {1,2,3,4,5}; /* tell compiler to generate a protected area for it*/ int main() { int *intp; int i; intp = (int *) array; for (i = 0; i < 5; i++) intp[i] ++; /* Access violation, the compiler does not detect it, * the system (processor +OS) may detect it */ return 0; }
Read Full Discussion Thread for this article