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 / gmail

#include<iostream.h>
#include<conio.h>
void main()
{
char str1[15],str2[15];
clrsacr();
cout<<"Enter a string";
cin>>str1;
cout<<"\nEnter another string to be located";
cin>>str2;
int n;
n=strstr(str1,str2);
if(n==0)
cout<<"\nstring not locatd";
else
cout<<"At location "<<(n+1);
getch();
}

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the c language function prototype?

1042


What are actual arguments?

1045


What is variables in c?

984


What are structure members?

1027


Explain the use of keyword 'register' with respect to variables.

969


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1741


difference between native and cross compilers

2080


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1258


Can I initialize unions?

987


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

3051


What is the purpose of clrscr () printf () and getch ()?

1023


What is the purpose of void pointer?

986


Explain #pragma statements.

979


What is the ANSI C Standard?

1212


Can we assign string to char pointer?

1042