home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4314 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.1 KB

  1. Path: sparky!uunet!wupost!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!drkszk
  2. From: drkszk@ocf.berkeley.edu (Derek Suzuki)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Initializing arrays in GCC/2
  5. Keywords: gcc/2 gcc2.1
  6. Message-ID: <16s8b0INNboo@agate.berkeley.edu>
  7. Date: 19 Aug 92 01:32:16 GMT
  8. Organization: U.C. Berkeley Open Computing Facility
  9. Lines: 15
  10. NNTP-Posting-Host: whirlwind.berkeley.edu
  11.  
  12.  
  13.     I'm attempting to pass an array pointer to a class constructor.
  14. What I'd like to do is allocate the array before initializing the 
  15. object, then pass the pointer to the constructor (which would copy
  16. the address to a private pointer).  However, the compiler says it
  17. doesn't implement the ability to initialize one array with another
  18. of an incompatible type.
  19.     I tried passing the address of the first element, but this
  20. seems to be getting me protection violations.  I did this sort of thing
  21. under DOS all the time, so I really hope it is allowed.  I can
  22. copy the contents of the original array into a new one that belongs
  23. to the object, but this seems very inefficient.  Any suggestions?
  24.  
  25. Derek Suzuki
  26. drkszk@ocf.berkeley.edu
  27.