Tuesday, 27 August 2013

strstr and strchr functions in c

#include<conio.h>
#include<stdio.h>
#include<string.h>

int main()
{
    char s1[20]="rajashekar";
   
    if(strstr(s1,"kak")) printf("raj is present in s1\n");
   
    if(strchr("hello", 'e')) printf("e is in hello\n");
   
   
    getch();
    return 0;
}   

No comments:

Post a Comment