1 #include<iostream>
   2 using namespace std;
   3 
   4 #include "tableau.hpp"
   5 
   6 // compilation: c++ -o tableau tableau.hpp main.cpp
   7 int main() {
   8         
   9         Tableau T1(10);
  10         for (size_t i=0; i<10; i++) {
  11                 T1[i]=10;
  12         };
  13         
  14         cout << "\n======== OPERATION Tableau T2 = T1\n";
  15         Tableau T2 = T1;
  16         cout << "OPERATION Tableau T2 = T1    T1= " << T1 << '\n';
  17         cout << "                             T2= " << T2 << '\n';
  18         
  19         cout << "\n======== OPERATION T1 += T2\n";
  20         T1 += T2;
  21         cout << "OPERATION T1 += T2       --> T1= " << T1 << '\n';
  22         cout << "                         --> T2= " << T2 << '\n';
  23         
  24         cout << "\n======== OPERATION T1 += 45\n";
  25         T1 += 45;
  26         cout << "OPERATION T1 += 45       --> T1= " << T1 << '\n';
  27 
  28         cout << "\n======== OPERATION T3 =  T1 + T2\n";
  29         Tableau T3(10);
  30         T3 = T1 + T2;
  31         cout << "OPERATION T3 =  T1 + T2  --> T1= " << T1 << '\n';
  32         cout << "                         --> T2= " << T2 << '\n';
  33         cout << "                         --> T3= " << T3 << '\n';
  34         
  35         // Une manière moins jolie mais moins couteuse de faire une addition
  36         cout << "\n======== OPERATION Tableau T4=T1; T4 += T2\n";
  37         Tableau T4(T1);
  38         T4 += T2;
  39         cout << "OPERATION Tableau T4=T1;T4+=T2 --> T1= " << T1 << '\n';
  40         cout << "                               --> T2= " << T2 << '\n';
  41         cout << "                               --> T3= " << T3 << '\n';
  42         
  43         cout << "C'EST FINI !\n";
  44         return 0;
  45 }
  46