Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

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

 pointeur
Download

#include <iostream>
 
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;
}
----------------------------------------------------------------------------

No comments yet.

Leave a Comment