home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19939 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.5 KB

  1. 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
  2. From: maennig@siggi.informatik.uni-dortmund.de (Olaf Maennig)
  3. Newsgroups: comp.lang.c++
  4. Subject: How use new to create a 2-dimensional array
  5. Date: 26 Jan 1993 15:45:45 GMT
  6. Organization: CS Department, Dortmund University, Germany
  7. Lines: 26
  8. Sender: maennig@siggi (Olaf Maennig)
  9. Distribution: world
  10. Message-ID: <1k3mb9INNdkb@fbi-news.Informatik.Uni-Dortmund.DE>
  11. Reply-To: maennig@siggi.informatik.uni-dortmund.de
  12. NNTP-Posting-Host: siggi.informatik.uni-dortmund.de
  13.  
  14. Hi, netters!
  15.  
  16. I'm a beginner in C++, so please no flames!
  17.  
  18. I haven't achieved to create a two-dimensional array via the new operator
  19. yet. In fact, I want to have an array containing pointers to self-defined
  20. structs (but that's not the point).
  21.  
  22. I tried:
  23.     my_struct **var;
  24.     ...
  25.     var = new (my_struct*)[number];
  26.  
  27. That doesn't work (why?).
  28. Who can tell me what I'm doing wrong and how to make it right?
  29.  
  30. Thanx.
  31.     Olaf
  32. -- 
  33.  ---------------------------------------------------------------------------
  34.      _                   Department of Computer Science IV
  35.     / \     |\/|         University of Dortmund, Germany
  36.     \_/laf  |  |aennig   e-mail: maennig@siggi.informatik.uni-dortmund.de
  37.          ------------------------------------------------------------
  38.          "To unnderstand recursion you need to understand recursion."
  39.  ---------------------------------------------------------------------------
  40.