Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C, implement function const char *qstr_strstr(const char *str1, const char *str2) that searches for the substring str2 from the string str1 . The function

In C, implement function const char *qstr_strstr(const char *str1, const char *str2) that searches for the substring str2 from the string str1. The function should return a pointer to the first occurance of str2 in str1. If the substring isnt found, the function should return NULL (note that NULL is defined in stddef.h header). Remember that the function should only search until the first ? character. (Do not use string.g library)

For example, if the function gets the following strings as parameters:

char *str1 = "Auto ajoi katua pitkin?"; char *str2 = "katu?";

it should return a pointer that points to the first character of the word katua where the first occurance of the substring katu begins.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

=+impact when these municipalities build stadiums and arenas?

Answered: 1 week ago