Advertisement
Guest User

J'ai trouvé

a guest
May 25th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.60 KB | None | 0 0
  1. void ouverture_soft(Soft soft_array[6]){
  2.     FILE* fichier = NULL;
  3.     char caractere[TAILLE_MAX];
  4.  
  5.     fichier = fopen("SOFT.csv", "r");
  6.     if(fichier != NULL)
  7.     {
  8.     }
  9.     else
  10.     {
  11.         printf("impossible d'ouvrir le fichier");
  12.     }
  13.  
  14.     // Define our soft array to store all lines in CSV file
  15.  
  16.     int cpt = 0;
  17.     // get the whole line for each
  18.     while(fgets(caractere, TAILLE_MAX, fichier) != NULL)
  19.     {
  20.         // Get all the strings delimited by a ';'
  21.         char ** array = str_split(caractere, ';');
  22.  
  23.         // Define a new structure
  24.         Soft soft;
  25.  
  26.         // copy the content of each properties in the structure
  27.         strcpy(soft.soft, array[0]);
  28.         strcpy(soft.ram, array[1]);
  29.         strcpy(soft.rom, array[2]);
  30.         strcpy(soft.puis_graph, array[3]);
  31.         strcpy(soft.puis_proc, array[4]);
  32.         strcpy(soft.usp, array[5]);
  33.         // add this structure in the array defined previousment
  34.         soft_array[cpt++] = soft;
  35.     }
  36.  
  37.     fclose(fichier);
  38. }
  39.  
  40. void affichage_graphics(){
  41.     printf("1: Marque\n");
  42.     printf("2: Modele\n");
  43.     printf("3: Nombre de ports VGA\n");
  44.     printf("4: Nombre de ports DVI\n");
  45.     printf("5: Nombre de ports HDMI\n");
  46.     printf("6: Nombre de ports MINIDP\n");
  47.     printf("7: Unique Selling Points\n");
  48.     printf("8: Taux de fiabilite\n");
  49.     printf("9: Restrictions d'usage\n");
  50.     printf("10: Prix\n");
  51.     printf("11: Indice de performance\n");
  52.     printf("12: Consommation electrique\n");
  53.     printf("13: Coefficient d'overclocking\n\n");
  54.     printf("0: Quitter la selection\n");
  55. }
  56.  
  57. void affichage_motherboard(){
  58.     printf("1: Marque\n");
  59.     printf("2: Modele\n");
  60.     printf("3: Type de socket processeur\n");
  61.     printf("4: Nombre de socket\n");
  62.     printf("5: Nombre d'emplacement de RAM\n");
  63.     printf("6: Version de la RAM\n");
  64.     printf("7: Nombre de ports PCIE 16\n");
  65.     printf("8: Nombre de ports IDE\n");
  66.     printf("9: Nombre de ports SATA\n");
  67.     printf("10: Nombre de ports USB\n");
  68.     printf("11: Nombre de ports VGA\n");
  69.     printf("12: Nombre de ports DVI\n");
  70.     printf("13: Nombre de ports reseau\n");
  71.     printf("14: Format de la carte\n");
  72.     printf("15: Unique Selling Points\n");
  73.     printf("16: Taux de fiabilite\n");
  74.     printf("17: Restrictions d'usage\n");
  75.     printf("18: Prix");
  76.     printf("19: Consommation electrique\n");
  77.     printf("20: Coefficient d'overclocking\n\n");
  78.     printf("0: Quitter la selection\n");
  79. }
  80.  
  81. void affichage_ecran(){
  82.     printf("1: Marque\n");
  83.     printf("2: Modele\n");
  84.     printf("3: Taille(en pouces)\n");
  85.     printf("4: Resolution maximale\n");
  86.     printf("5: Type de port\n");
  87.     printf("6: Unique Selling Points\n");
  88.     printf("7: Taux de fiabilite\n");
  89.     printf("8: Restrictions d'usage\n");
  90.     printf("9: Prix\n");
  91.     printf("10: Indice de performance\n");
  92.     printf("11: Consommation electrique\n\n");
  93.     printf("0: Quitter la selection\n");
  94. }
  95.  
  96. void affichage_hdd(){
  97.     printf("1: Marque\n");
  98.     printf("2: Modele\n");
  99.     printf("3: Espace disque (en Go)\n");
  100.     printf("4: Type de port\n");
  101.     printf("5: Unique Selling Points\n");
  102.     printf("6: Taux de fiabilite\n");
  103.     printf("7: Restrictions d'usage\n");
  104.     printf("8: Prix\n");
  105.     printf("9: Indice de performance\n");
  106.     printf("10: Consommation electrique\n\n");
  107.     printf("0: Quitter la selection\n");
  108. }
  109.  
  110. void affichage_proco(){
  111.     printf("1: Marque\n");
  112.     printf("2: Modele\n");
  113.     printf("3: Type de socket processeur\n");
  114.     printf("4: Frequence\n");
  115.     printf("5: Nombre d'emplacement de RAM supporte\n");
  116.     printf("6: Unique Selling Points\n");
  117.     printf("7: Taux de fiabilite\n");
  118.     printf("8: Restrictions d'usage\n");
  119.     printf("9: Prix\n");
  120.     printf("10: Indice de performance\n");
  121.     printf("11: Consommation electrique\n");
  122.     printf("12: Codefficient d'overclocking\n\n");
  123.     printf("0: Quitter la selection\n");
  124. }
  125.  
  126. void affichage_soft(){
  127.     printf("1: Nom du logiciel\n");
  128.     printf("2: RAM necessaire\n");
  129.     printf("3: Espace disque necessaire\n");
  130.     printf("4: Puissance graphique necessaire\n");
  131.     printf("5: Puissance processeur necessaire\n");
  132.     printf("6: Unique Selling Points\n\n");
  133.     printf("0: Quitter la selection\n");
  134. }
  135.  
  136. int main(){
  137.     int i;
  138.     processeur proco_array[11];
  139.     Ram ram_array[11];
  140.     processeur proco_recherche;
  141.     Ram ram_recherche;
  142.     Ram sortie;
  143.     ouverture_proco(proco_array);
  144.     ouverture_ram(ram_array);
  145.     //ouverture_Ecran();
  146.     //demande_proco(proco_array, &proco_recherche);
  147.     demande_ram(ram_array, &ram_recherche);
  148.     return 0;
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement