Ajout des fonctions de décalage à gauche/droite

doc
Rémi LAVERGNE 1 year ago
parent 882fb79be4
commit bdb6ac8daa
No known key found for this signature in database
GPG Key ID: 8861D8A4AD21A032

@ -0,0 +1,25 @@
/**
* @file decalage.c
* @brief Fonctions de décalage d'un tableau
*
* Contient les fonctions de décalage de tableau vers la droite (pour l'insertion)
* et vers la gauche (pour la suppression).
*/
#include "main.h"
void decalageADroite(int tab[], int index, int tlog)
{
for (int i = tlog; i > index; i--)
{
tab[i] = tab[i-1];
}
}
void decalageAGauche(int tab[], int index, int tlog)
{
for (int i = index; i < tlog; i++)
{
tab[i] = tab[i+1];
}
}

@ -27,6 +27,10 @@ void sauvegardeDonnees(int tLogArticle, int tLogClient, int reference[], float w
void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[], int tLogArticle);
void sauvegardeClients(int clientID[], int clientPassword[], float cagnotte[], int suspended[], int isAdmin[], int tLogClient);
//! DECALAGES TABLEAUX
void decalageADroite(int tab[], int index, int tlog);
void decalageAGauche(int tab[], int index, int tlog);
//! GESTION CLIENTS
int inputClient(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int *tlog);
void modifyClient(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlog);

Loading…
Cancel
Save