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
What is an arrays?
Why c language?
Can we replace the struct function in tree syntax with a union?
What is pointer & why it is used?
Why functions are used in c?
What tq means in chat?
what will be the output for the following main() { printf("hi" "hello"); }
what is the different bitween abap and abap-hr?
How can I trap or ignore keyboard interrupts like control-c?
What does dm mean sexually?
Why we write conio h in c?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
What is the difference between Printf(..) and sprint(...) ?
Can you pass an entire structure to functions?
What do you understand by normalization of pointers?