Posted by: testdirector August 3, 2005
Login in to Rate this Post:
0
?
![](/wysiwyg/editor/images/smiley/msn/thumbs_up.gif)
![10 more flags than likes deactivates post.](/wysiwyg/editor/images/smiley/msn/thumbs_down.gif)
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;
}