67 060
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #17738 in C++ for Akhil Menon

Question #17738
WAP having func named search which scans a string from beginning to end in search of a character.If the character is found it should return a pointer to the first occurance of the given character in the string else, the function should return a null,if not found.
Expert's answer

char* search(char* str, char w)
{
for(int i=0;i<strlen(str);++i)
if(str[i]==w)
return (str+i);
return NULL;
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions