Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!ccu.umanitoba.ca!salomon From: salomon@ccu.umanitoba.ca (Dan Salomon) Newsgroups: comp.lang.c Subject: Re: Is there a good example of how toupper() works? Message-ID: <1990Oct17.190701.21304@ccu.umanitoba.ca> Date: 17 Oct 90 19:07:01 GMT References: <2466@ux.acs.umn.edu> Organization: University of Manitoba, Winnipeg, Canada Lines: 20 In article jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) writes: >Try this one: > >void strupper(char *str) >{ >for (;*str!='\0';str++) > *str=toupper(*str); >} There is a problem with this solution on some systems. Berkeley UNIX BSD 4.3 requires that the parameter of toupper be a lowercase letter. The result is undefined if it is not. Therefore the test using islower may be necessary on some systems. This makes toupper pretty useless in portable programs, but those are the breaks. -- Dan Salomon -- salomon@ccu.UManitoba.CA Dept. of Computer Science / University of Manitoba Winnipeg, Manitoba R3T 2N2 / (204) 275-6682