Question
C++ LANGUAGE Using only pointer notation, implement and test the following functions that operate on C Strings: char *strStr(const char *s1, const char *s2) -
C++ LANGUAGE
Using only pointer notation, implement and test the following functions that operate on C Strings:
char *strStr(const char *s1, const char *s2)
- Locates the string s2 as a substring of s1 and returns a pointer to its first occurrence in s1 or nullptr if s2 is not a substring of s1
char *strrChr(constant char *s, int ch)
- Returns a pointer to the last occurrence of the character ch in string s or nullptr if ch is not in s
longAtoL(const char *s)
- Converts string s into an integer, stops after the first non digit is found: e.g. for string "123.45" number 123 is returned
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started