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