Hello, I'm wondering if there is a library with a toupper() kind of function that can handle string insted of char?
Code:
#include <iostream>
#include <ctype.h>
using namespace std;
void toUpperCase(char*);
int main() {
char str[80];
cout << "Enter something: ";
cin.getline(str, 80);
toUpperCase(str);
cin.get();
return 0;
}
void toUpperCase(char* s) {
int count;
while(*s) {
*s = toupper(*s);
s++;
count++;
}
s -= count;
cout << s;
}
this is what I've got now, but I want to use string instead
as I remember it I could use ASCI values of the upper case letters to convert, but that's sounds tiresome. Why reinvent something that maybe already exists, right?