Convert a string to uppercase.
#include <string.h> | Required only for function declarations |
char *_strupr( char *string );
char __far * __far _fstrupr( char __far *string );
string | String to be capitalized |
These functions convert any lowercase letters in the string to uppercase. Other characters are not affected.
The _fstrupr function is a model-independent (large-model) form of the _strupr function. The behavior and return value of _fstrupr are identical to those of the model-dependent function _strupr, with the exception that the argument and return value are far pointers.
These functions return a pointer to the converted string. There is no error return.
_strupr
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:DOS32X
_fstrupr
Standards:None
16-Bit:DOS, QWIN, WIN, WIN DLL
32-Bit:None
/* STRLWR.C: This program uses _strlwr and _strupr to create
* uppercase and lowercase copies of a mixed-case string.
*/
#include <string.h>
#include <stdio.h>
void main( void )
{
char string[100] = "The String to End All Strings!";
char *copy1, *copy2;
copy1 = _strlwr( _strdup( string ) );
copy2 = _strupr( _strdup( string ) );
printf( "Mixed: %s\n", string );
printf( "Lower: %s\n", copy1 );
printf( "Upper: %s\n", copy2 );
}
Mixed: The String to End All Strings!
Lower: the string to end all strings!
Upper: THE STRING TO END ALL STRINGS!