1 
   2 #include <iostream>
   3 using namespace std;
   4 
   5 #define DIMENSION 10
   6 
   7 void remplitA(int A[],size_t s) {
   8         for (int i=0; i<s;i++) {
   9                 A[i] = i;
  10         };
  11 }
  12 
  13 main() {
  14         int A[DIMENSION];
  15         remplitA(A,DIMENSION);
  16         
  17         const int * a        = A+5;
  18         int * const b        = A+5;
  19         const int * const c = A+5;
  20         int * d              = A+5;
  21 
  22         //  *a = 10;                        // Erreur !!!
  23         cout << "*a = " << *a << endl;
  24         remplitA(A,DIMENSION);
  25         cout << "*a = " << *a << endl;
  26         a++;
  27         cout << "*a = " << *a << endl;
  28 
  29         cout << "*b = " << *b << endl;
  30         //  b++;                                // Erreur !!
  31         *b=100;
  32         cout << "*b = " << *b << endl;
  33 
  34         cout << "*c = " << *c << endl;
  35         remplitA(A,DIMENSION);
  36         //  *c = 0;                     // Erreur !!
  37         //  c++;                                // Erreur !!
  38         cout << "*c = " << *c << endl;
  39 
  40         cout << "*d = " << *d << endl;
  41         remplitA(A,DIMENSION);
  42         *d = 0;
  43         d++;       
  44         cout << "*d = " << *d << endl;
  45 
  46 }
  47