Solved

tolower() done manually

Posted on 1999-01-20
3
246 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro will not compile after project converted from IAR to Microchip xc8 (in MPLab) 3 191
chcp 65001 File encoding 66 277
Problem to scan all sheets 3 111
Super Scope, DHCP 5 91
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

830 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