Solved

tolower() done manually

Posted on 1999-01-20
3
245 Views
Last Modified: 2010-04-15
I know that ctype.h has a tolower function.

If I wanted to write one manually...how is it done?

Thanks!
0
Comment
Question by:knowlton
3 Comments
 
LVL 16

Accepted Solution

by:
imladris earned 20 total points
ID: 1258224
It could be done as follows:

char tolower(char c)
{    if('A'<=c && c<='Z')return(c-'A'+'a');
     return(c);
}

0
 
LVL 84

Expert Comment

by:ozo
ID: 1258225
depending on your locale...
0
 
LVL 5

Author Comment

by:knowlton
ID: 1258226
Thank you.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question