program to locate string with in a string with using strstr
function
Answer Posted / pradeep
#include<stdio.h>
#include<string.h>
void main()
{
char *str1,*str2,*ptr;
printf("Enter string1:");
scanf("%s",&str1);
printf("Enter string2:");
scanf("%s",&str2);
ptr=strstr(str1,str2);
if(ptr==0)
printf("String not located");
else
printf("string located are %s",ptr);
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the role of this pointer?
What does sizeof int return?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is the role of && operator in a program code?
What are the advantages of the functions?
Define VARIABLE?
Can you please explain the scope of static variables?
Differentiate between a structure and a union.
What is the difference between pure virtual function and virtual function?
How do I swap bytes?
Do you know the difference between malloc() and calloc() function?
What is I ++ in c programming?
What is the purpose of the statement: strcat (S2, S1)?
Differentiate between the expression “++a” and “a++”?
Is a pointer a kind of array?