Hi,
Is it part of the c standard for the tolower() and toupper() functions to first check for an alpha char before performing the conversion?
thanks.
C tolower() function
Re:C tolower() function
non alpha dont have upper/lower case. and afaik, is not defined to work on non-english languages.?
so only A-Za-z work for ansi toupper/tolower
so only A-Za-z work for ansi toupper/tolower
-- Stu --
Re:C tolower() function
Thanks, I understand that, but what I mean is if a semi-colon (0x3b) is passed to the tolower() function, it will attempt to clear bit 5, which of course should not be done, so does it check for an alpha character before perofming the operation or does it just blindly clear bit 5?
thanks again.
thanks again.
Re:C tolower() function
tolower and toupper will handle non-alphabetic characters correctly.
From http://www.dinkumware.com/manuals/reader.aspx?b=p/&h=ctype.html#tolower:
tolower
[tt]int tolower(int c);[/tt]
The function returns the corresponding lowercase letter if one exists and if [tt]isupper(c)[/tt]; otherwise, it returns [tt]c[/tt].
toupper
[tt]int toupper(int c);[/tt]
The function returns the corresponding uppercase letter if one exists and if [tt]islower(c)[/tt]; otherwise, it returns [tt]c[/tt].
From http://www.dinkumware.com/manuals/reader.aspx?b=p/&h=ctype.html#tolower:
tolower
[tt]int tolower(int c);[/tt]
The function returns the corresponding lowercase letter if one exists and if [tt]isupper(c)[/tt]; otherwise, it returns [tt]c[/tt].
toupper
[tt]int toupper(int c);[/tt]
The function returns the corresponding uppercase letter if one exists and if [tt]islower(c)[/tt]; otherwise, it returns [tt]c[/tt].