Ciao, studiati questa funzione che fa proprio al caso tuo:
char *strtok( char *strToken, const char *strDelimit );

bye :metallica