Changes the Case of Output Function

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 376
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Changes the Case of Output Function

 
1
  #11
Apr 16th, 2009
What do you think the code is doing? Add some comments.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 136
Reputation: lancevo3 is an unknown quantity at this point 
Solved Threads: 0
lancevo3 lancevo3 is offline Offline
Junior Poster

Re: Changes the Case of Output Function

 
0
  #12
Apr 16th, 2009
  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.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 376
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Changes the Case of Output Function

 
0
  #13
Apr 16th, 2009
Especially the part before. xD
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 136
Reputation: lancevo3 is an unknown quantity at this point 
Solved Threads: 0
lancevo3 lancevo3 is offline Offline
Junior Poster

Re: Changes the Case of Output Function

 
0
  #14
Apr 16th, 2009
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" :\
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 376
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Changes the Case of Output Function

 
0
  #15
Apr 16th, 2009
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC