char * strtok ( char * str
, const char * delimiters
);
Split string into tokens
A sequence of calls to this function split str into tokens, which are sequences of contiguous characters separated by any of the characters that are part of delimiters.
On a first call, the function expects a C string as argument for str, whose first character is used as the starting location to scan for tokens. In subsequent calls, the function expects a null pointer and uses the position right after the end of last token as the new starting location for scanning.
To determine the beginning and the end of a token, the function first scans from the starting location for the first character not contained in delimiters (which becomes the beginning of the token). And then scans starting from this beginning of the token for the first character contained in delimiters, which becomes the end of the token.
This end of the token is automatically replaced by a null-character by the function, and the beginning of the token is returned by the function.
Once the terminating null character of str has been found in a call to strtok, all subsequent calls to this function with a null pointer as the first argument return a null pointer.
Para mas información revisa este enlace:
http://www.cplusplus.com/reference/clibrary/cstring/strtok/Creo que esto es lo que necesitas:
#include <stdio.h>
#include <string.h>
int main()
{
char cadena[] = "Hola\ta todos que\tal estais?";
char * ptr_token;
ptr_token
= strtok(cadena
,"\t ");
while(ptr_token)
{
ptr_token
= strtok(NULL
,"\t "); }
return 0;
}