no save
Assistance
Achat
News

Forum | programmation
mini probleme(programmation en C)
Selia, le ven. 07 avr. 2006 à 14:43:35
bjr merci de m'aider mais j'aimerai juste savoir pourquoi, le tableau affiche la premiere valeur selement (2.56)
merci,
le programme:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(){
double tab[255];
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 )
{
tab[nb_mot]=atof(pointeur);
nb_mot++; // increment du nombre de mot
}
getchar (); // pause en mode console

return 0 ;
} }
Précédentmamiemando
mars 06
mamiemando
avr. 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