Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<stdlib.h>
- struct Produit{
- int code;
- char libelle[30];
- float prix;
- };
- typedef struct Produit Produit;
- struct Pr_en_stocke{
- Produit P;
- int Qte;
- struct Pr_en_stocke* suivant;
- };
- typedef struct Pr_en_stocke Pr_en_stocke;
- typedef Pr_en_stocke* stocke;
- /*******************Ajoute****************/
- stocke ajoute_en_tete(stocke L ,Produit a,int q){
- stocke temp;
- temp=(stocke)malloc(sizeof(Pr_en_stocke));
- temp->P=a;
- temp->Qte=q;
- temp->suivant=L;
- return temp;
- }
- /*******************Affichage****************/
- void Afficher_Produit(Produit P)
- {
- printf("%d %s %.2f",P.code,P.libelle,P.prix);
- }
- void afficher_list(stocke L){
- stocke temp;
- if(temp=NULL)
- {
- printf("\n*******la liste*******");
- while(temp!=NULL)
- {
- Afficher_Produit(temp->P);
- printf("%d",temp->Qte);
- temp=temp->suivant;
- }
- }
- else
- printf("\n la liste est vide ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement