Download Starting Out with C++ from Control Structures to Objects Eighth Edition by Tony Gaddis easily in PDF format for free.
The string class is an abstract data type. This means it is not a built-in, primitive data type like int or char. Instead, it is a programmer-defined data type that accompanies the C++ language. It provides many capabilities that make storing and working with strings easy and intuitive. Chapter 10 Characters, C-Strings, and More About the string Class In the function countChars, strPtr points to the C-string that is to be searched and ch contains the character to look for.The first operand is less than the second operand if the mismatched character in the first operand is less than its counterpart in the second operand. Likewise, the first operand is greater than the second operand if the mismatched character in the first operand is greater than its counterpart in the second operand.
The while loop in lines 41 through 46 repeats as long as the character that strPtr points to is not the null terminator: while (*strPtr != ‘