The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Compiler is twitching at me. by Llyr2002-08-28 14:28:52
  New problem by Llyr2002-08-28 14:53:17
    Clarify, please... (n/t) by nhaggin2002-08-28 14:54:47
      Okay by Llyr2002-08-28 15:00:53
        Send me the source for the setHours function. by nhaggin2002-08-28 15:03:33
          How's about I posts it? by Llyr2002-08-28 15:07:53
            All righty then... by nhaggin 2002-08-28 15:17:20
I was just trying to avoid cluttering the board. :)

Well...there are a coupla issues here:

1. I assume you have an hours member of your class. If you do, then the problem line should read

hours = h;

or

this->hours = h;

The way you have it, a temporary variable named "hours" in your function is being used, and no class member data is being changed.

2. Your design of prompting the user for a valid hours value if the parameter is invalid is...odd, to say the least. In such a case, standard procedure is to do error-checking in an input loop elsewhere (main, for example), and have the method assume its parameter is valid.

[ Reply ]
              Then wouldn't I have to declare by Llyr2002-08-28 15:19:48
                Well... by nhaggin2002-08-28 15:24:13
                  It's giving me by Llyr2002-08-28 15:27:40
                    Oh, and by Llyr2002-08-28 15:30:28
                    OK. by nhaggin2002-08-28 15:34:28
                      Ohh! That's what I've been doing wrong! by Llyr2002-08-28 15:36:11
                        Shoot, it still doesn't work... by Llyr2002-08-28 15:39:42
                        okay know you've confused me by ToLazyToThink2002-08-28 18:41:25
                        No by ston2002-08-28 18:51:40
                          that or throw an exception by ToLazyToThink2002-08-28 19:08:51
                    what does your header file look like? by ToLazyToThink2002-08-28 15:46:39
                      Here it is by Llyr2002-08-28 16:34:15
                        shouldn't your getters... by ToLazyToThink2002-08-28 18:43:34
                          Void is my friend... by Llyr2002-08-28 19:19:10
                            I get it.... by ToLazyToThink2002-08-28 19:24:36

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)