Home
 
 
Search:  
C C++ Perl PHP Python HTML ShellScripts
 
 
  Coding Books
  Tutorials
  Search Code
  Browse Code
  Link to Us
  Site News
  Contact Metalshell
 
 
 
  Submit Code   Statistics
 



Practical Debugging in C++    (ISBN: 0130653942)


 

 List Price: $20.80
 Our Price: $20.80
 Used Price: $19.09

 Release Date: 15 January, 2002
 Manufacturer: Prentice Hall (Paperback)
 Sales Rank: 404,946

 Author: Ann R. Ford, Toby J. Teorey









More Info

 Lower Case 2002-08-30 13:04:40
  cpp 
Category: source:cpp:strings
Description: Conver upper case charecters in a string to lower case.
Platform: all
Author: detour
Viewed: 3173
Rating: 4/5 (10 votes)
If you have any questions about this piece of code or still need help, try posting your question on the forum.

 

Printable Version
lowcase.cpp
/* lowcase.cpp written by detour@metalshell.com
 * 
 * Function to convert upper case letters to lower case.
 *
 * http://www.metalshell.com
 *
 */

#include <iostream>
#include <cctype>

using namespace std;

void do_lowcase(char *);

int main() {
	char text[50];

	cout << "Enter a string: ";
	cin >> text;

	do_lowcase(text);

	cout << text << endl;

	return 0;
}

void do_lowcase(char *lc) {
	for(;*lc;lc++)
		*lc = (unsigned char)tolower((unsigned char)*lc);
}
Rate this code:
(Not Helpful)  (Very Helpful) 

 
 
   Developer.*  
   Blue Parrots  
   Technipal  
   Defy Magazine  
   Code Project  
   Prog. Heaven  


Got Money?