Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- CONTENU : file.c
- AUTEUR : ONILLON Aimeric
- CREATION : 13/12/2017
- MODIFICATION : 13/12/2017
- */
- // librairies
- #include "file.h"
- #include <stdbool.h>
- file init_file()
- {
- file f;
- f.head = 0;
- f.tail = 0;
- return f;
- }
- file ajouter(file f, element e)
- {
- f.tableau[f.head] = e;
- f.head++;
- return f;
- }
- file retirer(file f)
- {
- f.tail++;
- return f;
- }
- element premier(file f)
- {
- return f.tableau[f.head - 1];
- }
- element dernier(file f)
- {
- return f.tableau[f.tail];
- }
- bool file_vide(file f)
- {
- return (f.head == f.tail);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement