Advertisement
Dany1858

inf. struttura compiti esame

Jun 4th, 2015
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.09 KB | None | 0 0
  1.         /*include*/
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <malloc.h>
  5. #include <time.h>
  6. #include <string.h>
  7.  
  8.         /*define*/
  9. #define N 20
  10.  
  11.             /*strutture*/
  12. struct xxx {
  13.     -
  14.     -
  15.         struct xxx *next;
  16. };
  17.  
  18.             /*funzioni*/
  19. int menu(struct card *);
  20. -
  21. -
  22.  
  23.             /*main*/
  24. int main()
  25. {
  26.             /*inizializzazioni*/
  27.     -
  28.     -
  29.             /*corpo del main*/
  30.     while(1){
  31.     switch(menu()){
  32.          case 0: return 0;
  33.          case 1:{ -; break;}
  34.          case 2:{ -; break;}}
  35.          default:{ printf("\n\nOpzione non ammessa!"); getchar();}
  36.     }}
  37. }
  38.  
  39.         /*Funzione menu'*/
  40. int menu(struct listino *p, struct ricambi *pr)
  41. {
  42.         int opz=-1;
  43.         system("cls"); printf("\n");
  44.         while(opz<0 || opz>2){
  45.              if(p==NULL && pr==NULL) printf("\n1. carica database\n");
  46.              else printf("\n1. database caricato\n");
  47.              printf("\n2. cerca modello\n\n0. esci\t");
  48.              scanf("%d", &opz); if(opz<0 || opz>2){ system("cls"); getchar();
  49.              printf("!!!Inserire opzione corretta!\n");}}
  50.         return opz;
  51. }
  52.  
  53.         /*Funzioni*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement