How do I convert text in upper case to lower case? :?:
CodeBoy101
-2
Junior Poster in Training
Recommended Answers
Jump to PostThis function converts a string to lowercase usering OR
char *ToLowerCase(char *text) { char *str = new char[strlen(text)]; register int i; for (i=0;text[i];i++) str[i] = text[i] >= 'A' && text[i] <= 'Z' ? text[i] | 32 : text[i]; str[i] = '\0'; return str; }
Jump to PostWell thats pretty easy.
Use the library
cctype
#include <cctype>
And then you can use the tolower command. It just is opposite of toupper.
char c; cin>>c; char d=tolower(c); cout<<d;
Then that code takes in a character and converts into lowercase.
All 6 Replies
William Hemsworth
1,339
Posting Virtuoso
Sky Diploma
571
Practically a Posting Shark
CodeBoy101
commented:
Excellent!!
+1
William Hemsworth
1,339
Posting Virtuoso
Salem
5,138
Posting Sage
CodeBoy101
-2
Junior Poster in Training
Radical Edward
301
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.