C examples for ctype.h:toupper
function
<cctype> <ctype.h>
Convert lowercase letter to uppercase
int toupper ( int c );
Parameter | Description |
---|---|
c | Character to be converted, casted to an int, or EOF. |
The uppercase equivalent to c, if such value exists, or c (unchanged) otherwise.
The value is returned as an int value that can be implicitly casted to char.
#include <stdio.h> #include <ctype.h> int main ()/*from w w w . j a v a 2s .c o m*/ { int i=0; char str[]="This is a test. Test String.\n"; char c; while (str[i]) { c=str[i]; putchar (toupper(c)); i++; } return 0; }