C++ pointeur probM
Fermé
lavoiekeven
Messages postés
22
Date d'inscription
dimanche 7 octobre 2007
Statut
Membre
Dernière intervention
21 septembre 2009
-
7 oct. 2007 à 13:19
Marc - 7 oct. 2007 à 14:20
Marc - 7 oct. 2007 à 14:20
1 réponse
Bonjour,
Il te suffit d'utiliser la fonction 'strcmp' ;
par exemple :
if( !strcmp(Pt_Prof_Courant->Nom,nom) && !strcmp(Pt_Prof_Courant->Prenom,prenom) )
Extrait du manuel :
SYNOPSIS
#include <string.h>
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcmp() function compares the two strings s1 and s2. It returns
an integer less than, equal to, or greater than zero if s1 is found,
respectively, to be less than, to match, or be greater than s2.
The strncmp() function is similar, except it only compares the first
(at most) n characters of s1 and s2.
Il te suffit d'utiliser la fonction 'strcmp' ;
par exemple :
if( !strcmp(Pt_Prof_Courant->Nom,nom) && !strcmp(Pt_Prof_Courant->Prenom,prenom) )
Extrait du manuel :
SYNOPSIS
#include <string.h>
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcmp() function compares the two strings s1 and s2. It returns
an integer less than, equal to, or greater than zero if s1 is found,
respectively, to be less than, to match, or be greater than s2.
The strncmp() function is similar, except it only compares the first
(at most) n characters of s1 and s2.