// Converting lowercase letters to uppercase letters // using a non-constant pointer to non-constant data #include #include void convertToUppercase(char *); main() { char string[] = "characters and $32.98"; cout << "The string before conversion is: " << string << endl; convertToUppercase(string); cout << "The string after conversion is: " << string << endl; return 0; } void convertToUppercase(char *sPtr) { while (*sPtr != '\0') { if (*sPtr >= 'a' && *sPtr <= 'z') *sPtr = toupper(*sPtr); // convert to uppercase letter ++sPtr; // increment sPtr to point to the next character } }