#include <iostream>
#include <conio.h>

using namespace std;

int main ()
{    
    int num, *ptr1;
    int numbers[5] = {1, 3, 5, 7, 9};
                                         
    num = 10;
    ptr1 = &num;                                                                                              
    cout << "nom: " << num << endl;
    cout << "N1 : " << *ptr1 << endl;
     
    num = 15;
    cout << endl;
    cout << "num: " << num << endl;
    cout << "ptr1 : " << *ptr1 << endl;

    ptr1 = numbers + 4; //the name of the array also a pointer
                        //pointing to the first element = tata = tata[0]
                        //if you assign the name to another pointer variable ONLY! 
    cout << endl;
    cout << "num: " << num << endl;
    cout << "ptr1 : " << *ptr1 << endl;

    ptr1 = numbers; //ptr1 now point to the address point numbers[0];
    cout << endl;     
    cout << "*ptr1 : " << *ptr1 << endl;   // = numbers[0] = 1
    cout << "*ptr1+1 : " << *ptr1+1 << endl; // = numbers[0]+1 = 2
    cout << "*ptr1+2 : " << *ptr1+2 << endl; // = numbers[0]+2 = 3     
    cout << "*ptr1+3 : " << *ptr1+3 << endl; // = numbers[0]+3 = 4          
    cout << "*ptr1+4 : " << *ptr1+4 << endl; // = numbers[0]+4 = 5              
     
    cout << endl;
    cout << "*ptr1 : " << *ptr1 << endl;   // = numbers[0] = 1
    cout << "*(ptr1+1) : " << *(ptr1+1) << endl; // = numbers[1] = 3
    cout << "*(ptr1+2) : " << *(ptr1+2) << endl; // = numbers[2] = 5     
    cout << "*(ptr1+3) : " << *(ptr1+3) << endl; // = numbers[3] = 7          
    cout << "*(ptr1+4) : " << *(ptr1+4) << endl; // = numbers[4] = 9 
     
    return 0;
}

