home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19785 < prev    next >
Encoding:
Text File  |  1993-01-23  |  776 b   |  24 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!undergrad.math.waterloo.edu!mobius10.math.uwaterloo.ca!wgsteven
  3. From: wgsteven@mobius10.math.uwaterloo.ca (Warren Stevens)
  4. Subject: Need access to array index in ctor
  5. Message-ID: <C1A1nx.K2L@undergrad.math.waterloo.edu>
  6. Sender: news@undergrad.math.waterloo.edu
  7. Organization: University of Waterloo
  8. Date: Fri, 22 Jan 1993 22:40:44 GMT
  9. Lines: 13
  10.  
  11. I am creating a class, called block, that needs to know it's index in a
  12. constructor if it is created as part of an array.  For instance,
  13.  
  14.     House    block[512];
  15.  
  16. would call block::block() 512 times.  Each time the constructor is called, 
  17. i need to know what the index being created is.
  18.  
  19. Is there some way to do this easily?
  20.  
  21. Thanks,
  22.  
  23. Warren
  24.