#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Gorakhpur,U.P.,India
    Posts
    24
    Rep Power
    0
    Hi All,
    I wish to define two classes as classA and classB with classB having a variable sized array of classA objects. the size of this array will be determined when an instance of classB is created.

    i am unable to understand as to how it can be done. i would appreciate any help in this regard.

    thanks to all in advance.


    ------------------
    Anish Modi
    Infotech World
    India


    ------------------
    Anish Modi
    Infotech World
    India
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    15
    Hi,

    If you just make a constructor of class B that takes as an argument the number of Class A instances you would like to make, it will work!

    Greetz,
    Ramon

    ------------------
    Ramon Litjens
    Boradoli Web Design
    (www.boradoli.nl)

Similar Threads

  1. constant (static?) array of int in c++ class
    By Octofinger in forum C Programming
    Replies: 2
    Last Post: February 10th, 2004, 09:01 AM
  2. Calling a function that is inside a differend class
    By Skull-Splitter in forum C Programming
    Replies: 3
    Last Post: January 31st, 2004, 07:39 AM
  3. returning two names from a class object function
    By Bacat in forum C Programming
    Replies: 10
    Last Post: January 14th, 2004, 11:33 PM
  4. How do I make an object static within a class?
    By Bacat in forum C Programming
    Replies: 11
    Last Post: January 11th, 2004, 08:54 PM
  5. my comp sux lately , need help from pro's
    By Hykinsel007 in forum Windows Help
    Replies: 2
    Last Post: January 5th, 2004, 01:52 PM

IMN logo majestic logo threadwatch logo seochat tools logo