This documentation is copyright © 1998-2001 Sandro Sigala <sandro@sigala.it>.
All rights reserved.

Released under the GNU General Public License.

Return to index Return to header Previous symbol Next symbol

isupper

Prototype

#include <ctype.h>

int isupper(int c);

Description

In the ``C'' locale, returns a true value for the characters defined as uppercase letters. In other implementation-defined set of characters returns true for the characters for which none of iscntrl, isdigit, ispunct, or isspace is true.

Example

View source
#include <ctype.h>

/*
 * Return a true value if the argument string is a word in the
 * [A-Z][A-Za-z]* format, i.e. the first character is uppercase,
 * the others, if exist, uppercase or lowercase.
 */
int is_uword(const char *s)
{
    if (!isupper(*s))
	return 0;
    for (++s; *s != '\0'; ++s)
	if (!isalpha(*s))
	    return 0;
    return 1;
}

References

ISO C 9899:1990 7.3.1.10