home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ukma!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
- From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
- Subject: Re: Order of execution...
- Keywords: Umm, Uhh, Well, Daa, Gee
- References: <7942@lee.SEAS.UCLA.EDU>
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Sun, 30 Aug 1992 17:40:34 GMT
- Message-ID: <behrenss.715196434@hphalle6>
- Distribution: usa
- Lines: 31
-
- linley@seas.ucla.edu (Bruce Linley) writes:
-
- >This subroutine is supposed to convert a string to all lower case:
- >int StripCase(textLine)
- >char textLine[];
- >{
- > register int index = 0;
- >
- > while ((textline[index++] = tolower(textLine[index])) != '\0');
- >}
- >The question is will it always work?
-
- No.
-
- Better would be:
-
- for(;(textline[index] = tolower(textline[index])) != '\0';index++);
- ^
- I assume you made a typo here and
- there is no textLine.
-
- BTW, this will only work for "printable" ASCII characters, so you are in
- the dark if the text uses Umlaute or similar.
-
- Yours
- Soenke
- --
- ===========================================================================
- More than silver, more than gold, I need ! behrenss@informatik.
- electricity. I need it for my dreams. ! tu-muenchen.de
- (RACTER) ! FIDO: 2:246/13 Soenke Behrens
-