How do I convert the characters in buffer to upper case?
toolbox03
-3
Light Poster
Recommended Answers
Jump to PostHow about toupper()?
#include <ctype.h> [...] int main() { char up, buffer = 'a'; up = toupper(buffer); return 0; }
There is another way, although some people don't recommend using it, because it doesn't work on all charactersets
char buffer = 'a'; buffer += …
Jump to PostI am confused looking at this thread. To convert a lower case letter to upper case I always subtracted 32 from the lowercase letter. Adding 48? Is this correct or is it a mistake.
Please reply.
Jump to Postyes, you're absolutely right Prabakar.
funny thing is, i looked at it and didnt even notice. I was thinking how such a conversion could be applied incorrectly -- like what happens when you try and make an EOF or CR or LF or NULL character "uppercase"
I suspect …
All 9 Replies
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
toolbox03
-3
Light Poster
jephthah
1,888
Posting Maven
Radical Edward
301
Posting Pro
jephthah
1,888
Posting Maven
Prabakar
77
Posting Whiz
jephthah
commented:
good catch
+1
Nick Evan
commented:
Thanks for the correction. You're right
+6
jephthah
1,888
Posting Maven
Nick Evan
commented:
You're right, my brain misfired
+6
Prabakar
77
Posting Whiz
jephthah
1,888
Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.