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

How can you find the day of the week given the date?

1161


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1606


How can I read a binary data file properly?

1111


What are the types of arrays in c?

1122


What is the purpose of ftell?

1051


What are loops in c?

967


Explain the process of converting a Tree into a Binary Tree.

2627


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

1258


Tell me can the size of an array be declared at runtime?

1002


What is meant by preprocessor in c?

973


Explain can you assign a different address to an array tag?

1023


What are the features of the c language?

1056


What is data structure in c language?

1075


What is character set?

1132


What 'lex' does?

1113