Name
isupper
Synopsis
Ascertains whether a given character is an uppercase letter
#include <ctype.h> intisupper
( intc
);
The function isupper()
tests whether its character argument is a capital letter. If the
character is a uppercase letter, isupper()
returns a nonzero value (that
is, true
); if not, the function
returns 0 (false
).
Which characters are letters and which letters are uppercase
both depend on the current locale setting for the category LC_CTYPE
, which you can query or change
using the setlocale()
function.
In the default locale C
, the
truth values of isupper()
and
islower()
are mutually exclusive
for the alphabetic characters. However, other locales may have
alphabetic characters for which both isupper()
and islower()
return true
, or characters which are alphabetic,
but are neither upper- nor lowercase.
Example
See the examples at setlocale()
and
isprint()
in this
chapter.
See Also
islower()
, tolower()
, toupper()
; the
corresponding C99 function for wide characters, iswupper()
; isalnum()
, isalpha()
, isblank()
, iscntrl()
, isdigit()
, isgraph()
, isprint()
, ispunct()
, isspace()
, isxdigit()
, setlocale()
Get C in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.