Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //Programmer: Dinalyn Degano
- //Completed:
- //Status: Complete
- #include <iostream> // input/output declaration.
- #include <string> // needed to use setprecision
- #include <cctype>
- #include <cstring>
- using namespace std;
- void upperFormat(char *stringInput);
- int main()
- {
- //max string length
- const int MAX_LENGTH = 51;
- char stringInput[MAX_LENGTH];
- //string stringOutput;
- string upperFormat;
- cout << "Enter a string (up to" << MAX_LENGTH - 1 << " characters): ";
- cin.getline(stringInput, MAX_LENGTH);
- cout << "You entered" << stringInput;
- upperFormat(stringInput);
- return 0;
- }
- void upperFormat(char *stringInput)
- {
- //char upCharacter;
- //char currentCharacter;
- //string upperFormat = stringInput;
- int count = 0;
- while (*stringInput != '\0') {
- if (!isupper(*stringInput)) {
- cout << *stringInput;
- }
- }
- //for(int i = 0; i < stringInput.length(); i++)
- //{
- // char currentCharacter = stringInput.at(i);
- //}
- // if (islower(currentCharacter))
- // {
- // char upCharacter = toupper(currentCharacter);
- // string upperCaseString(0, upCharacter);
- // upperFormat.replace(i + stringInput, 0, upperCaseString);
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement