Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Why do some versions of toupper act strangely if given an upper-case letter?
Why do some versions of toupper act strangely if given an upper-case letter? Why does some code call islower before toupper?
✍: Guest
In earlier times, toupper was a function-like preprocessor macro and was defined to work only on lower-case letters; it misbehaved if applied to digits, punctuation, or letters which were already upper-case. Similarly, tolower worked only on upper-case letters. Therefore, old code (or code written for wide portability) tends to call islower before toupper, and isupper before tolower.
The C Standard, however, says that toupper and tolower must work correctly on all characters, i.e. characters which don't need changing are left alone.
2015-08-17, 1203👍, 0💬
Popular Posts:
How To Create an Add-to-Netvibes Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...
Which is the best place to store ConnectionString in Dot Net Projects? I am about to deploy my first...
How can we suppress a finalize method? GC.SuppressFinalize ()
What is Shell scripting A shell script is a script written for the shell, or command line interprete...
How To Set session.gc_divisor Properly? - PHP Script Tips - Understanding and Using Sessions As you ...