Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!timbuk!cs.umn.edu!ux.acs!edh From: edh@ux.acs.umn.edu (Eric "The Mentat Philosopher" Hendrickson) Newsgroups: comp.lang.c Subject: Is there a good example of how toupper() works? Message-ID: <2466@ux.acs.umn.edu> Date: 16 Oct 90 18:29:21 GMT Reply-To: edh@ux.acs.umn.edu (Eric D. Hendrickson) Organization: Frobozz Magic Amulet of Yendor Company Lines: 35 Basically, what I want to do is take a string of upper/lower case, and make it all upper case. Here is a first try at it, #include main() { char *duh = "Hello"; printf("%s\n", duh); while (*duh <= strlen(duh)) { if (islower(*duh)) *duh = toupper(*duh); *duh++; } printf("%s\n", duh); } And what I get is : Hello Hello What I want is: Hello HELLO Can anybody point out a good way of doing this? Thanks much, Eric Hendrickson -- /----------"Oh carrots are divine, you get a dozen for dime, its maaaagic."-- |Eric (the "Mentat-Philosopher") Hendrickson Academic Computing Services |edh@ux.acs.umn.edu The game is afoot! University of Minnesota \-"What does 'masochist' and 'amnesia' mean? Beats me, I don't remember."--