Just starting to learn C++ Question about classes

This is a discussion on Just starting to learn C++ Question about classes within the C++ Programming forums, part of the General Programming Boards category; Hi Folks, I have just started to learn C++ and I'm really excited about it as it seems extremely powerful. ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,420
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,420
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21