i am trying to take input for name and return it with only the first letters of the name as capital....i am able to it the first name but m unable to move on to the second and last name.... please help..
string ToUpper(string n)
{
for(int i=0;i<n.length();i++)
{
string m = n;
for(int i = 1; i < m.length(); i++)
m[i] = tolower(m[i]);
if (n[i] >='a' && n[i] <='z')
n[i]=n[i]-32;
return m;
return n;
}
}