Thread: Binary numbers
View Single Post
Re: Binary numbers
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Binary numbers - 02-04-2004

Meh!
Quote:
Originally Posted by Lazy
In the following example the function takes a lowercase character and XORs it with 00100000 to convert it to an uppercase character.
(...)
Is there a way to do the same thing with C?
Sure there is
Code:
#include <string.h>
 
   char lowerCaseCharacter = 'c';
 
   char upperCaseCharacter = toupper (lowerCaseCharacter);
Works on any architecture, any character set and even unicode. Fast.
Why bother with non-portable code ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote