Abstract

The strlwr and strupr functions convert ASCIIZ strings to all upper case or all lower case.  Non-alphabetic characters in the string are not affected. 

Usage

These functions are used to convert ASCIIZ strings to all upper case or all lower case. 

Header Files

string.h
strlwr, strupr
string
std::strlwr, std::strupr

Prototype

char * strlwr ( char * S );

char * strupr ( char * S );

Arguments

S
A pointer to the string to be comverred. 

Return Values

strlwr
A pointer to the argument string after conversion to lower case. 
strupr
A pointer to the argument string after conversion to upper case. 

Side Effects

strlwr
The argument string is converted to lower case. 
strupr
The argument string is converted to upper case. 

Remarks

Example

/************************************************
 * File:        convert.cpp
 * Description: Short program showihg case 
 *              conversion functions.
 * Date:        11/12/08
 ************************************************/

#include <iostream.h>
#include <string.h>

int main () {
  char Hello [] = "Hello";
  char * Lower;
  
  cout << "The initial string is: " << Hello << "\n";
  strupr (Hello);
  cout << "The upper case string is: " << Hello << "\n";
  Lower = strlwr (Hello);
  cout << "The lower case string is: " << Lower << "\n";
  
  return 0;
}

Output


    

External Links

MSDN strlwr, wcslwr Visual Studio 8.0 (2005)
MSDN strupr, wcsupr Visual Studio 8.0 (2005)