C/C+: Utilisation des noms des tableau comme des pointeurs

Author:

 pointeur
Download

#include 

using namespace std;

int main()
{

    int tab[] = {15, 30, 5, 9, 20};

    cout << "Accès aux éléments du tableau.";
    cout << *tab << endl;      //Premier élément
    cout << *(tab + 1) << endl;
    cout << *(tab + 2) << endl;
	cout << *(tab + 3) << endl;
    cout << *(tab + 4) << endl;
    return 0;
}

Leave a Reply

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