Code Library
Home Submit Free Hosting Link To Us Contacts

CPP Upper Case

CPP Upper Case CPP CPP Upper Case Download (.zip)



#include <iostream>
#include <cctype>

using namespace std;

void do_upcase(char *);

int main() {
        char text[50];

        cout << "Enter a string: ";
        cin >> text;

        do_upcase(text);

        cout << text << endl;

        return 0;
}

void do_upcase(char *lc) {
        for(;*lc;lc++)
                *lc = (unsigned char)toupper((unsigned char)*lc);
}




  • CPPLower Case Upper Case


Tatet