home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!Informatik.Uni-Dortmund.DE!siggi!maennig
- From: maennig@siggi.informatik.uni-dortmund.de (Olaf Maennig)
- Newsgroups: comp.lang.c++
- Subject: How use new to create a 2-dimensional array
- Date: 26 Jan 1993 15:45:45 GMT
- Organization: CS Department, Dortmund University, Germany
- Lines: 26
- Sender: maennig@siggi (Olaf Maennig)
- Distribution: world
- Message-ID: <1k3mb9INNdkb@fbi-news.Informatik.Uni-Dortmund.DE>
- Reply-To: maennig@siggi.informatik.uni-dortmund.de
- NNTP-Posting-Host: siggi.informatik.uni-dortmund.de
-
- Hi, netters!
-
- I'm a beginner in C++, so please no flames!
-
- I haven't achieved to create a two-dimensional array via the new operator
- yet. In fact, I want to have an array containing pointers to self-defined
- structs (but that's not the point).
-
- I tried:
- my_struct **var;
- ...
- var = new (my_struct*)[number];
-
- That doesn't work (why?).
- Who can tell me what I'm doing wrong and how to make it right?
-
- Thanx.
- Olaf
- --
- ---------------------------------------------------------------------------
- _ Department of Computer Science IV
- / \ |\/| University of Dortmund, Germany
- \_/laf | |aennig e-mail: maennig@siggi.informatik.uni-dortmund.de
- ------------------------------------------------------------
- "To unnderstand recursion you need to understand recursion."
- ---------------------------------------------------------------------------
-