In C++, create a method that finds a character in a c style string using pointers
Question
Create a method that searches through str for the character chr. If the chr is found, it returns a pointer into str where the character was first found, otherwise nullptr (not found).
Explanation
findTheChar method has 2 parameters, an array of char, which is the c style string, and chr, which is the character to find in the string. Within the method, there is a for loop which iterates from 0 until a null terminator is…