// demonstrates the use of const with passing arrays as parameters // mikhail nesterenko // 2/27/2001 void func2(int []); // parameter is an array without const modifier void func1(const int []); // parameter is a const array int main(void){ int a[3]={0, 1, 2}; func1(a); // passes array } void func1(const int b[]){ b[0]++; // increments const array - not allowed func2(b); // passes const array to a function that accepts // array as non-const, not allowed either } void func2(int c[]){ c[1]++; }