convert a string to uppercase
#include <string.h> char *strupr( char *s1 ); char *_strupr( char *s1 ); char __far *_fstrupr( char __far *s1 );
The strupr() and _fstrupr() functions replace the string s1 with uppercase characters, by invoking the toupper function for each character in the string.
The _strupr() function is identical to strupr(). Use _strupr() for ANSI naming conventions.
The _fstrupr() function is a data-model-independent form of the strupr() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.
the address of the original string s1
#include <stdio.h> #include <string.h> char source[] = { "A mixed-case STRING" }; void main() { printf( "%s\n", source ); printf( "%s\n", strupr( source ) ); printf( "%s\n", source ); }
produces the output:
A mixed-case STRING A MIXED-CASE STRING A MIXED-CASE STRING
WATCOM
_strupr() conforms to ANSI naming conventions.