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
Is void a keyword in c?
Which programming language is best for getting job 2020?
explain what is an endless loop?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
When we use void main and int main?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Explain function?
What are variables and it what way is it different from constants?
How can I write a function analogous to scanf?
In c programming language, how many parameters can be passed to a function ?
what do you mean by inline function in C?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
What are the types of variables in c?
What is string function in c?
Is that possible to add pointers to each other?