943,696 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 887
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Apr 16th, 2009
1

Re: Changes the Case of Output Function

What do you think the code is doing? Add some comments.
Reputation Points: 69
Solved Threads: 28
Posting Whiz
Clockowl is offline Offline
376 posts
since May 2008
Apr 16th, 2009
0

Re: Changes the Case of Output Function

C++ Syntax (Toggle Plain Text)
  1. while(*n != NULL)//enters loop when there is a character
  2. {
  3. if(isalpha(*n)) break;//test to make sure character is a letter
  4. n++;
  5. }
  6. *n = toupper(*n);//converts to uppercase
  7. n++;
  8.  
  9. while(*n != NULL)//while the character holds something
  10. {
  11. *n = tolower(*n);//convert to lowercase
  12. n++;
  13. }
  14. n++;
Last edited by lancevo3; Apr 16th, 2009 at 1:59 pm.
Reputation Points: 10
Solved Threads: 0
Junior Poster
lancevo3 is offline Offline
146 posts
since Feb 2009
Apr 16th, 2009
0

Re: Changes the Case of Output Function

Especially the part before. xD
Reputation Points: 69
Solved Threads: 28
Posting Whiz
Clockowl is offline Offline
376 posts
since May 2008
Apr 16th, 2009
0

Re: Changes the Case of Output Function

That part I'm really not sure, we were giving that code in class, I was confused when we got it. Of course when I went to see my professor yesterday I was told the good ole "you'll figure it out" :\
Reputation Points: 10
Solved Threads: 0
Junior Poster
lancevo3 is offline Offline
146 posts
since Feb 2009
Apr 16th, 2009
0

Re: Changes the Case of Output Function

Look up the functions and what they do, then put comments in there: it makes the code way more readable for yourself. If you can't figure out what a function does (which I doubt, using google and C(++) references) you can always ask.
Last edited by Clockowl; Apr 16th, 2009 at 2:06 pm.
Reputation Points: 69
Solved Threads: 28
Posting Whiz
Clockowl is offline Offline
376 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: help needed
Next Thread in C++ Forum Timeline: Polymorphism question in a C++ example





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC