Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #define DIM 10
- int main()
- {
- int tab[DIM];
- int i;
- int *tab2;
- srand(time(NULL));
- for (i=0; i < DIM; i++)
- {
- tab[i] = rand()%10;
- }
- printf("Affichage : \n");
- for (i = 0; i < DIM; i++)
- {
- printf("%d ", tab[i]);
- }
- printf("\n");
- printf("Affichage avec pointeur : \n");
- for (i = 0; i < DIM; i++)
- {
- printf("%d ", *(tab+i) );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement