Match function: Using C++ pointers, create a method that returns true if and only if its two C string arguments have exactly same text

All About Code
2 min readMay 20, 2022

Question

The match function is supposed to return true if and only if its two C string arguments have exactly same text.

Explanation

Within the match method, 2 pointer variables are declared for str1 and str2.

‘const char *p1 = str1;’ line will declare a constant (cannot manipulate) variable with the memory address of…

--

--