Hello guys,
Is their any function api available to convert a character to lowercase(eg:- A to a) in C,I tried with tolower but it returns a ASCII value but i need a character as return type,help me if you know.
thanks in advance
Printable View
Hello guys,
Is their any function api available to convert a character to lowercase(eg:- A to a) in C,I tried with tolower but it returns a ASCII value but i need a character as return type,help me if you know.
thanks in advance
char cUpper = 'A';,
char cLower;
cLower= tolower(cUpper );
printf("%c",cLower);
As luvjd79 wrote you could use C-runtime function tolower (_tolower, towlower) to convert single character to lower case.
You can also use CharLower Windows API to convert either a single character or the whole string.
Hello Lindley,
I need a special character Like (ä,ö,ü) to be converted to Lowerse in Linux using C/C++, I tried using tolower() but it always return -60 which is not the ASCII value of ä(228),kindly let me know if their any API available.Here is my program in.
int main()
{
char *n="Ä";
printf("%d\n",*n); //before conversion printing -60, this is wrong should return 196
int a=tolower((int)*n);
printf("%d\n",a); //After conversion returns -60 which is really wrong.
}
Well, this Forum isSo you might want to ask it in Non-Visual C++ Forum.Quote:
Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.
From MSDN:And in your example the characters from the range between 0x7F and 0xFF are used!Quote:
Example
/* TOUPPER.C: This program uses toupper and tolower to
* analyze all characters between 0x0 and 0x7F. It also
* applies _toupper and _tolower to any code in this
* range for which these functions make sense.
*/
Is their any datatype available for storing special characters since decimal value of special characters are Ä=196 ä=228 etc.in c++ in windows
char, unsigned char - for ASCII,
wchar_t - for UNICODE