Tuesday, October 13, 2009

strtok

#include
#include
#include
/*Write a Program to split the given string like
str [] ="1>2>3>4>5>" using string tokenizer*/
int main()
{
char str[]="1>2>3>4>5>";
char *a;
a=strtok(str,">");
printf("%s\n",a);
a=strtok(NULL,">");
printf("%s\n",a);
a=strtok(NULL,">");
printf("%s\n",a);
a=strtok(NULL,">");
printf("%s\n",a);
a=strtok(NULL,">");
printf("%s\n",a);
getch();
return 0;
}

No comments:

Post a Comment