Question: for data structures and algorithms in C++ by drozdek in Chapter 1, Problem 5E why are you returning a char not an int???? edit -

for data structures and algorithms in C++ by drozdek

in

Chapter 1, Problem 5E

why are you returning a char not an int????

edit - i dont understand why you return a char in this question...:

for data structures and algorithms in C++ by drozdek in Chapter 1,

Please help thanks

Program Code: * This program demonstrates implementation of string functions using pointers #include #include using namespace std I/(a) Strlen function //The function strienO" finds length of string. It takes /header pointer of character array as function arguments I/checks until the string reaches null and calculates //length of the string. int Strlen(char *s) //Declare a character pointer "tmp" and assign "s" to it char *tmp = s; //Check until null charater reaches while (*s++'o'); //length of the string return s -tmp -1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!