no save
Assistance
Achat
News

Forum | programmation
mini probleme(programmation en C)
mamiemando, le jeu. 30 mars 2006 à 09:53:00
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(){
char *pointeur;
char *separateur = { "*-+/eE" }; // Le séparateur
char *buffer;
char *Chaine_Entrante="2.56e-8*3.14";
int nb_mot=1;

buffer = strdup ( Chaine_Entrante );

// premier appel,
pointeur = strtok( buffer, separateur );
printf ("Mot de la phrase numero : %d %s\n",nb_mot, pointeur);

while( pointeur != NULL )
{
// Cherche les autres separateur
pointeur = strtok( NULL, separateur );
if ( pointeur != NULL )
{
nb_mot++; // increment du nombre de mot
printf ("Mot de la phrase numero : %d %s\n",nb_mot, pointeur);
//faire le atof ici
}
}

getchar (); // pause en mode console

return 0 ;
}
PrécédentSelia
mars 06
Selia
mars 06
Suivant
REPONSES
mamiemando
mars 06
Selia
mars 06
mamiemando
mars 06
Selia
mars 06
mamiemando
mars 06
Selia
avr. 06
mamiemando
avr. 06
Selia
avr. 06
mamiemando
avr. 06
Version Web
Réalisé par RedShift
no save