0
I have the following code:
#include <iostream>
#include <ctype.h>
using namespace std;
int main() {
string nome = "pedro", up;
for (int n = 0 ; n != nome.length(); n++) {
up += toupper(nome[n]);
}
cout << "SEJA BEM-VINDO(A), " << up << endl;
return 0;
}
That generates the output:
SEJA BEM-VINDO(A), PEDRO
There is a C++ function that converts a string to uppercase without having to loop through letter by letter using the toupper()
to capitalize characters, as done in the above code?
Did the answer resolve what was in doubt? Do you need something else to be improved? Do you think it is possible to accept it now?
– Maniero