Thread: Just starting to learn C++ Question about classes

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    Just starting to learn C++ Question about classes

    Hi Folks,
    I have just started to learn C++ and I'm really excited about it as it seems extremely powerful.
    I am just getting my head around classes and I am wondering if it is possible to create groups of classes.

    for example; if I had a class called Ball, how would I write a program to make Ball1, Ball2, Ball3 etc etc.

    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Like an array for example
    ball poolTable[16];
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    4
    Many thanks, will try it out.

    Is this only way or are there other techniques?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Well there's also all of the containers in the Standard Template Library (STL)
    Such things as
    - Vectors
    - Lists
    - Hashes
    - Maps

    But don't try and comprehend it all at the same time.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-28-2006, 02:59 PM
  2. Simple Question about Classes
    By Loctan in forum C++ Programming
    Replies: 5
    Last Post: 06-26-2006, 02:40 AM
  3. A little question about classes
    By Newbeee in forum C++ Programming
    Replies: 9
    Last Post: 06-15-2006, 03:46 PM
  4. Replies: 2
    Last Post: 06-11-2006, 05:56 PM
  5. Newbie question about the Private type in classes
    By Ryeguy457 in forum C++ Programming
    Replies: 1
    Last Post: 09-07-2002, 10:17 PM