cctype library

hi everyone,
can you help me with this code:

#include <iostream>
#include <cctype>

using namespace std;

int main()
{
char ch;
cin>>ch;
while (ch!='x')
{
toupper(ch);
cout<<ch<<endl;
}

return 0;
}

it doesnt change to upper case laters.
thank you!
there is another code:

int main()
{
char ch;
cin.get(ch);
while (isdigit(ch))
{
cout<<ch<<endl;
cin.get(ch);
}

return 0;
}

why does the loop get in trouble with cin.get(ch) while cin>>ch doesn't?
Last edited on
Topic archived. No new replies allowed.