Question: Rewrite Example 8.3 so that it uses direct pointer reference, described at the end of Chapter 6, rather than array indexing. If you have reached

Rewrite Example 8.3 so that it uses direct pointer reference, described at the end of Chapter 6, rather than array indexing. If you have reached the end of the string, the value of the current character is a null-termi- nator, so you can test for the end-of-string condition by using *p == '\0'. You can also use *p itself as the condition, because it is nonzero if its not pointing to a zero (or null) value. while (*p++) { // Do some stuff... } c++

Rewrite Example 8.3 so that it uses direct pointer reference, described at

Convert to Uppercase es.3. In this example, I'll show a simple program that accesses individual characters. Remember that although you can think of a string as a single entity, it's actually made up of a series of characters, which are typically (but not always) uppercase and lowercase letters upper.cpp #include #include #include using namespace std; ? continued on next page 196 Chapter 8 Strings: Analyzing the Text upper.cpp, cont. void convert to_upper(char s); int mainO char s[100]; cout

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!