Previous Next Up Index Contents

Exercice 10.33

long CH_ENTIER(char *CH)
{
 /* Variables locales */
 long N;
 int SIGNE;
 /* Traitement du signe */
 SIGNE = 1;
 if (*CH=='-') SIGNE = -1;
 if (*CH=='-' || *CH=='+') CH++;
 /* Conversion des chiffres */ 
 for (N=0 ; *CH>='0' && *CH<='9' ; CH++)
         N = N*10 + (*CH-'0');
 return SIGNE*N;
}


Previous Next Up Index Contents


Feedback - Copyright © 1993,1996,1997 F.Faber