Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int tab[10];
  7. int *p,i;
  8.  
  9. for(i=0;i<10;i++)
  10. {
  11. tab[i]=0;
  12. }
  13.  
  14. i=5;
  15. p=tab;
  16. p=tab+i;
  17.  
  18. printf("\t\t\tQuestions de Cours \n\n\n");
  19. printf("Donnees : i=5 p=tab+i=tab+5 *p =tab[5]=%d .\n(p=adresse ; *p=valeur)\n\n\n",*p);
  20. (*p)++;
  21. printf("a) - Operation : (*p)++ \n ==> *p = tab[5] = %d\n\n",*p);
  22. p++;
  23. printf("b) - Operation : p++\n ==> *p = tab[6] = %d\n\n",*p);
  24. (*p)++;
  25. printf("c) - Operation : (*p)++\n ==> *p = tab[6] = %d\n\n",*p);
  26. (*(p+2))++;
  27. printf("d) - Operation : (*(p+2))++\n ==> *p = tab[8] = %d\n\n",*p);
  28. (*(tab+2))++;
  29. printf("e) - Operation : (*(tab+2))++\n ==> tab[2] = %d\n\n",tab[2]);
  30. getch();
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement