C/C++: Comparer les adresses des pointeurs

Author:

 pointeur, adresse
Download


#include 
using namespace std;
const int Lengh = 3;

int main ()
{
      int tab[] = {10, 9, 8, 7, 6
                ,5, 4, 3, 1, 0};
   int* pointeur_int = tab;
   int i = 0;
   	int size=sizeof(tab)/sizeof(tab[0]);

   while (pointeur_int <= &tab[size- 1])//Comparer les adresses
   {
      cout<<"Adresse de l'index "<< i << "="<< pointeur_int
      << ", sa Valeur= " << *pointeur_int << endl;
      pointeur_int++;
      i++;
   }
   return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *