C++ String first letter to upercase

Hello
How to make the first latter in an array of strings to uppercase??

1
2
3
4
5
 string example[5] = "hello", "nice", "noooo", "fun", "lol";
for(int o = 0; o < 5; o++)
{
 cout << example[o] << endl;
}
(Sorry of the code looks bad, on my laptop without VB)
Will come out as:
hello
nice
etc...
but I want it to be
Hello
Nice
etc...
Use std::toupper() from the cctype library.

http://www.cplusplus.com/reference/cctype/toupper/
Topic archived. No new replies allowed.