home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 12975 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  961 b 

  1. Path: sparky!uunet!ulowell!news.bbn.com!usc!elroy.jpl.nasa.gov!ucla-cs!ucla-se!seas.ucla.edu
  2. From: linley@seas.ucla.edu (Bruce Linley)
  3. Newsgroups: comp.lang.c
  4. Subject: Order of execution...
  5. Keywords: Umm, Uhh, Well, Daa, Gee
  6. Message-ID: <7942@lee.SEAS.UCLA.EDU>
  7. Date: 29 Aug 92 04:17:22 GMT
  8. Sender: news@SEAS.UCLA.EDU
  9. Distribution: usa
  10. Organization: SEASnet, University of California, Los Angeles
  11. Lines: 18
  12.  
  13. This subroutine is supposed to convert a string to all lower case:
  14.  
  15. int StripCase(textLine)
  16. char textLine[];
  17. {
  18.   register int index = 0;
  19.   
  20.   while ((textline[index++] = tolower(textLine[index])) != '\0');
  21. }
  22.  
  23. The question is will it always work? Or will sometimes work depending on which
  24. side of the assignment gets evaluated first (up to the compiler)? Is there a
  25. better way to do this (and still keep it a one liner). Thnaks in advance.
  26.  
  27. --
  28. Bruce Linley         | Evil code:
  29. linley@seas.ucla.edu | #define BEGIN {
  30. Comp Sci & Engr      | #define END }
  31.