Voici un petit exemple trés sympas qui repondra parfaitement à ton problème:
char *strtok(char *s, const char *delim);
Cette fonction découpe une chaîne en sous-chaînes en focntion d'un ensemble de délimiteurs. La fonctin est initialiser en passant la chaîne à décomposer en premier paramètre, elle retourne alors le premier champ. Pour récuperer les autres champs il faut appeler strtok() avec NULL comme premier paramètre. Quand il n'y a plus de champs dans la chaîne la fonction retourne NULL.
Exemple :
#include
int main(int argc, char*argv[]){
char chaine[]="GET http://machine/fichier HTTP/1.0";
char *champ;
champ = strtok(chaine, "\t ");
while(champ!=NULL){
printf("%s\n",champ);
champ = strtok(NULL, "\t ");
}
}