You are not logged in. Please login at www.codechef.com to post your questions!

×

What is strstr(s1,s2) in c++ ?

What is strstr(s1,s2) in c++ ?

Can anyone explain withthe help of an answer

asked 06 Dec, 16:44

pandey_96's gravatar image

2★pandey_96
666
accept rate: 0%

I think this type of question can be easily googled. Did you try that?

(06 Dec, 20:02) vijju123 ♦4★

Refer Here
This function takes two strings s1 and s2 as an argument and finds the first occurrence of the sub-string s2 in the string s1. The process of matching does not include the terminating null-characters(‘\0’), but function stops there.

link

answered 06 Dec, 17:12

kailashnath199's gravatar image

5★kailashnath199
1162
accept rate: 23%

edited 06 Dec, 17:12

The concept is very simple Firstly it is a pre-f=defined function in C++

strstr(s1,s2); //This simply means that this function returns a "pointer" to the first occurence of string s2 in that string.

Hope this statement made it clear for you. Happy coding !

link

answered 08 Dec, 15:33

saiff_ansari's gravatar image

0★saiff_ansari
112
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×418

question asked: 06 Dec, 16:44

question was seen: 149 times

last updated: 08 Dec, 15:33