#include<iostream.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
void main ( )
{
char s [ 20 ], s1 [ 20 ], s2 [ 20 ], *p = " " ;
int i ;
clrscr();
cout<< "\n Input string :" ;
gets ( s );
cout<< "\n Enter second string " ;
gets ( s2 );
strcpy ( s1, s );
p = strtok ( s2, " " ) ;
for ( i = 0; p ; i ++ )
{
if ( strcmp ( p, s2 ) == 0 )
cout << "\n string found " ;
p = strtok ( NULL, " " ) ;
}
getch ( ) ;
}
0 comments:
Post a Comment