Hey new guy here
what is the correct syntax to use toupper on input using cin
example
char ans;
cin << ans; <-------------------- want it to be uppercase char to the computer regardless of if they use lower case or not
Syntax
Started by restin84, Mar 26 2009 04:16 PM
4 replies to this topic
#1
Posted 26 March 2009 - 04:16 PM
|
|
|
#2
Posted 26 March 2009 - 04:37 PM
You might be able to do something like the following. It has been a while since I have coded in C.
if(ans[0] >= 65 && ans[0] <= 90) ans[0] = ans[0]+32;
#3
Posted 26 March 2009 - 05:06 PM
That will work on some system, not on others.
There is an uppercase flag you can set to control input/output.
There is an uppercase flag you can set to control input/output.
#4
Posted 26 March 2009 - 07:34 PM
well I'm using visual studio or xcode.
#5
Posted 27 March 2009 - 05:38 AM


Sign In
Create Account


Back to top









