Thread: ???

  1. #1
    Registered User whistlenm1's Avatar
    Join Date
    Jan 2002
    Posts
    124

    ???

    Hi Guys

    I am finally taking the step from C into C++, so here is my question . I am wondering is their a specific programming reason or just programmer preference when declaring methods inside or outside of a class.

    Thanks in advance
    whistlenm1
    Man's mind once streched by a new idea, never regains its original dimensions
    - Oliver Wendell Holmes

    In other words, if you teach your cat to bark (output) and eat dog food (input) that doesn't make him a dog. It would have to chase cars, chew bones, and have puppies before I'd call it Rover ;-)
    - WaltP

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    i am wondering why you are asking this question in this forum...???? why not use one of the c forums?

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Because the C forums are usually used when people actually want code.

    Anyways - for your question - Yes, there are programming reasons. Declaring a method in the class promotes encapsulation. If there's no methods in the class, it's really not much more that a struct.

Popular pages Recent additions subscribe to a feed