program to locate string with in a string with using strstr
function
Answer Posted / pradeep
#include<stdio.h>
#include<string.h>
void main()
{
char *str1,*str2,*ptr;
printf("Enter string1:");
scanf("%s",&str1);
printf("Enter string2:");
scanf("%s",&str2);
ptr=strstr(str1,str2);
if(ptr==0)
printf("String not located");
else
printf("string located are %s",ptr);
}
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How can I find out how much free space is available on disk?
Why is #define used?
What is malloc calloc and realloc in c?
Explain what is the most efficient way to store flag values?
Do you know the purpose of 'register' keyword?
What is c basic?
Why do we use c for the speed of light?
How does pointer work in c?
What are variables and it what way is it different from constants?
What is wrong with this statement? Myname = 'robin';
How can I call a function with an argument list built up at run time?
How can I determine whether a machines byte order is big-endian or little-endian?
What is the full form of getch?
What are directives in c?
What is c system32 taskhostw exe?