|
|
| 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. |
/* 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);
}
|
|
|