Need Help making string uppercase

This is the code I have so far but for some reason, it doesn't output the inputted name uppercase.

#include <iostream>
#include <string>
using namespace std;
void upper_name(string myname);

int main()
{
string myname;
int i;
cout << "Enter your name" << endl;
getline(cin, myname);
myname.length();

cout << "Your name is ";
cout << static_cast<char>(toupper(myname[i]));
cout << "The length of your name including any spaces is " << myname.length() << " characters.\n";

system("pause");
return 0;
}

void upper_name(string myname){
for (int i=0; i<(myname.length()); i++)
{
cout << static_cast<char>(toupper(myname[i]));
}}
Of course it doesn't. Look at it carefully again.
Topic archived. No new replies allowed.