Friday, 26 January 2018

Write a program to study the use of strtok(). System Programming GTU 2150708


Program:-

#include<string.h>
#include<stdio.h>
int main()
{
            char str[80]="A /&string/@of/%$^tokens";
            const char s[12]="/,!@#$%^&* ";
            char *token;
            token =strtok(str, s);
            while(token!=NULL)
            {
                        printf("%s\n",token);
                        token=strtok(NULL, s);
            }
            return 0;
}




Output:-

A
string
of
tokens

No comments:

Post a Comment

It's time To increase blogging capability. To have a chance to contribute in digital world. Any Interested People who want to make t...