This documentation is copyright © 1998-2001 Sandro Sigala <sandro@sigala.it>.
All rights reserved.
Released under the GNU General Public License.
toupper
Prototype
#include <ctype.h>
int toupper(int c);
Description
Returns the uppercase character corresponding to the character c
,
if the value of islower
with the argument c
is true, otherwise returns
the c
argument unchanged.
Example
#include <ctype.h>
/*
* Capitalize the argument word.
*/
char *capitalize_word(char *s)
{
char *sp;
if (*s == '\0')
return s;
*s = toupper(*s);
for (sp = s + 1; *sp != '\0'; ++sp)
*sp = tolower(*sp);
return s;
}
References
ISO C 9899:1990 7.3.2.2