Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is an arrays?

1028


Why c language?

1006


Can we replace the struct function in tree syntax with a union?

1238


What is pointer & why it is used?

1061


Why functions are used in c?

1070


What tq means in chat?

1063


what will be the output for the following main() { printf("hi" "hello"); }

10799


what is the different bitween abap and abap-hr?

2217


How can I trap or ignore keyboard interrupts like control-c?

1020


What does dm mean sexually?

1261


Why we write conio h in c?

964


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

1845


What is the difference between Printf(..) and sprint(...) ?

1426


Can you pass an entire structure to functions?

1078


What do you understand by normalization of pointers?

1005