The function not working properly it's deleating only the id_capt and changing the value of another to zero...
Besides I want to do verification that the sensor does belong to the list but it's not working
void suppression_capt(Liste* liste)//id donner par utilisateur a modifier
{
float new_longitude,new_latitude;//vals a modifier
char id_capt_user[10];
Element *courant = liste->premier;
Element *precedent =courant;
printf("donner id_capt= ");
scanf("%s",id_capt_user);
while(courant != NULL)
{
if(strcmp(courant->capt.id_capt,id_capt_user)==0)
{
precedent=courant->suivant;
free(courant);
}
courant=courant->suivant;
}
printf("\n");
}
Besides I want to do verification that the sensor does belong to the list but it's not working
/*do
{
printf("donner id_capt= ");
scanf("%s",id_capt_user); //verification du capteur
courant=courant->suivant;
}while(strcmp(courant->capt.id_capt,id_capt_user)!=0);*/
and here is the struct that I used
typedef struct//valeur d'une cellule/noeud
{
char id_capt[10];
float longitude;
float latitude;
}capt_hum;
typedef struct//liste chainee
{
capt_hum capt;
struct Element* suivant;
struct Element* precedent;
}Element;