Answer to Question #6491 in C++ for shubham chandak

Question #6491
WAP to find the starting position of the sub string in the main string.for eg: the position of "abc(substring)" in "scabc(main string)" is 3.
1
Expert's answer
2012-02-14T10:04:34-0500

#include <string>
#include <iostream>

using namespace std;

int main ()
{
string a, b;
cin>>a>>b;

cout<<a.find(b);

system ("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS