Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1875 connectés 

  FORUM HardWare.fr
  Programmation
  C

  Gestion de Produit

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Gestion de Produit

n°1716973
marychang
Posté le 13-04-2008 à 17:23:53  profilanswer
 

bonjour,

 

J'ai commencé à programmer en c depuis peu et je m'entraîne avec un programme sur la gestion de produit, j'ai beau relire, je n'arrive pas à corriger mes erreurs si quelqu'un pourrait m'aidez?

  

(travail sous visual c++)

 

merci


Message édité par marychang le 20-04-2008 à 15:15:33
mood
Publicité
Posté le 13-04-2008 à 17:23:53  profilanswer
 

n°1716982
tpierron
Posté le 13-04-2008 à 18:24:17  profilanswer
 

Ouch. Laisse moi deviner. Tu as écris ces 1500 lignes de code sans compiler une seule fois et tu t'étonnes d'avoir 237 warnings et 149 erreurs à la compilation.
 
Sérieux, lis les messages de ton compilateur, certaines erreurs sont d'une stupidité affligeante (sans ignorer les warnings, ou ton programme va te ramasser comme une grosse merde la première fois que tu vas le lancer).
 
Je ne sais pas combien de fois tu as essayé de compiler ton programme, mais si c'est zéro, même avec mes 10 ans de C, je ne m'amuserais pas à ça. C'est complètement suicidaire, je n'ose pas imaginer le nombre d'erreur de logique qu'il doit y avoir là dedans.


Message édité par tpierron le 13-04-2008 à 18:26:55
n°1716992
marychang
Posté le 13-04-2008 à 18:44:30  profilanswer
 

Après avoir corrigé, il reste une erreur dans cette fonction:

 

error C2065: 'NumProduit' : undeclared identifier

 



Message édité par marychang le 20-04-2008 à 15:15:25
n°1717016
xilebo
noone
Posté le 13-04-2008 à 21:07:07  profilanswer
 

Ligne 11 :/*voir*/ tmp.NumProduit=(i+j)>NumProduit;
 
 
Tu as oublié un signe "-" :
 

Code :
  1. tmp.NumProduit=(i+j)->NumProduit;

n°1717040
marychang
Posté le 13-04-2008 à 22:16:11  profilanswer
 

merci , j'ai corrigé plusieurs erreurs et quand j'exécute toute s'affiche en boucle, quelqu'un pourrait m'aider à corriger ou à me dire ce qu'il ne va pas??

 

lien corrigé:

 

merci


Message édité par marychang le 20-04-2008 à 15:15:03
n°1717052
tpierron
Posté le 13-04-2008 à 23:17:19  profilanswer
 

Je t'avais dis de faire gaffe aux warnings :
 

:: === Gestion, Debug ===
E:\Projets\Utilities\Gestion\perso.c:87: warning: return type of 'main' is not `int'
E:\Projets\Utilities\Gestion\perso.c:: In function `main':
E:\Projets\Utilities\Gestion\perso.c:133: warning: implicit declaration of function `getch'
E:\Projets\Utilities\Gestion\perso.c:: In function `AjoutProd':
E:\Projets\Utilities\Gestion\perso.c:294: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:324: warning: comparison between pointer and integer
E:\Projets\Utilities\Gestion\perso.c:337: warning: passing arg 1 of `strcpy' makes pointer from integer without a cast
E:\Projets\Utilities\Gestion\perso.c:339: warning: passing arg 1 of `strcpy' makes pointer from integer without a cast
E:\Projets\Utilities\Gestion\perso.c:341: warning: passing arg 1 of `strcpy' makes pointer from integer without a cast
E:\Projets\Utilities\Gestion\perso.c:374: warning: format argument is not a pointer (arg 2)
E:\Projets\Utilities\Gestion\perso.c:381: warning: char format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:388: warning: passing arg 1 of `TriSt' from incompatible pointer type
E:\Projets\Utilities\Gestion\perso.c:271: warning: unused variable `x'
E:\Projets\Utilities\Gestion\perso.c:271: warning: unused variable `a'
E:\Projets\Utilities\Gestion\perso.c:: In function `SupprimProd':
E:\Projets\Utilities\Gestion\perso.c:516: warning: int format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:: In function `AfficheUn':
E:\Projets\Utilities\Gestion\perso.c:602: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:605: warning: format argument is not a pointer (arg 2)
E:\Projets\Utilities\Gestion\perso.c:: In function `TriProd':
E:\Projets\Utilities\Gestion\perso.c:644: warning: suggest parentheses around assignment used as truth value
E:\Projets\Utilities\Gestion\perso.c:: In function `AjoutDep':
E:\Projets\Utilities\Gestion\perso.c:804: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:810: warning: char format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:832: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:857: warning: int format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:785: warning: unused variable `x'
E:\Projets\Utilities\Gestion\perso.c:785: warning: unused variable `j'
E:\Projets\Utilities\Gestion\perso.c:: In function `AfficheUnDep':
E:\Projets\Utilities\Gestion\perso.c:939: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:941: warning: int format, pointer arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:944: warning: double format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:946: warning: format argument is not a pointer (arg 2)
E:\Projets\Utilities\Gestion\perso.c:: In function `RechercheDep':
E:\Projets\Utilities\Gestion\perso.c:1040: warning: int format, different type arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:: In function `AjoutSt':
E:\Projets\Utilities\Gestion\perso.c:1262: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:1265: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:1278: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:: In function `AfficheUnSt':
E:\Projets\Utilities\Gestion\perso.c:1380: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:1381: warning: int format, long int arg (arg 2)
E:\Projets\Utilities\Gestion\perso.c:1382: warning: int format, long int arg (arg 2)
:: === Build finished: 0 errors, 33 warnings ===


n°1720053
marychang
Posté le 18-04-2008 à 18:10:16  profilanswer
 

bonjour,

  

voici mon code un peu amélioré...
mon problème se trouve surtout au modification de produit ou dépôt, car quand il n'y a aucun produit ou dépôt, ça fonctionne mais dés qu'il en trouve un il ne veut pas le modifier.

 


merci


Message édité par marychang le 20-04-2008 à 15:14:57
n°1720120
tpierron
Posté le 18-04-2008 à 21:04:55  profilanswer
 

Au risque de paraitre cassant, ton code est truffé d'incohérence et d'erreurs flagrantes typiques de quelqu'un qui débute. Maintenant, si tu ne sais pas configurer ton compilateur, fait un nouveau sujet, plutôt qu'essayer de coller des rustines et des béquilles à un code qui ne demande qu'à s'écrouler. Tu n'as pas du tout les bases du langage C, je te conseille de soit te prendre un bouquin pour te mettre à niveau, soit utiliser un langage nettement moins casse gueule que le C (et avec une coube d'apprentissage moins raide).
 
Tiens, je parie que tu ne sais même pas ce que fait exactement ce genre d'instruction : (trouvé dans ton code)
 

Code :
  1. char TypeProduit;
  2. int Categorie;
  3. TypeProduit ='SF';
  4. Categorie = 'Oui';
  5. Categorie ="non";
  6. short r;
  7. scanf("%d",&r);
  8. printf("%s\t ", TypeProduit);
  9. while(y=0 && strcmp((i+y)->NomProduit,tmp.NomProduit)>0)


Message édité par tpierron le 18-04-2008 à 21:07:21

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C

  Gestion de Produit

 

Sujets relatifs
gestion des fenétresGestion de fichier sur site web
Gestion des bounce emailGestion d' "erreur" avec trigger_error() - bien/pas bien ?
Script de gestion d'articleshtaccess et gestion des sous-domaines
Gestion de code source à afficher sur une page (insertion code en bdd)Conseil sur gestion de la BDD [SQL]
Gestion de Message (PostMessage,....)[JAVA SWING] probleme avec la gestion des layout manager
Plus de sujets relatifs à : Gestion de Produit


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR