Advertisement
LOVEGUN

testing

May 20th, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. struct Page {
  5. char nom_proprietaire[10];
  6. int date_creation, nombre_visites;
  7. };typedef struct Page Tpage;
  8.  
  9. void remplir (int T[],int n)
  10. {
  11. int i;
  12. for (i=0;i<n;i++)
  13. {
  14. T[i]=1;
  15. }
  16. }
  17. void affiche1(Tpage pages)
  18. {
  19. printf("%s | %d | %d\n",pages.nom_proprietaire,pages.date_creation,pages.nombre_visites);
  20. }
  21.  
  22.  
  23. void Ajoutpage2(Tpage *page) {
  24. printf("Saisir le nom du prop:\n");
  25. scanf("%s", page->nom_proprietaire);
  26. printf("Saisir la date de creation:\n");
  27. scanf("%d", &page->date_creation);
  28. printf("Saisir le nombre d'internautes:\n");
  29. scanf("%d", &page->nombre_visites);
  30. }
  31.  
  32. int main ()
  33. {
  34. int T[20];
  35. int n;
  36. Tpage *p;
  37. Ajoutpage2 (&p);
  38. printf ("%s",p->nom_proprietaire);
  39. affiche1 (*p);
  40.  
  41.  
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement