home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18507 < prev    next >
Encoding:
Text File  |  1992-12-29  |  947 b   |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!gatech!taco!jlnance
  3. From: jlnance@eos.ncsu.edu (JAMES LEWIS NANCE)
  4. Subject: Newing a pointer to a pointer
  5. Message-ID: <1992Dec29.174843.20250@ncsu.edu>
  6. Originator: jlnance@chow2.ece.ncsu.edu
  7. Sender: news@ncsu.edu (USENET News System)
  8. Reply-To: jlnance@eos.ncsu.edu (JAMES LEWIS NANCE)
  9. Organization: North Carolina State University, Project Eos
  10. Date: Tue, 29 Dec 1992 17:48:43 GMT
  11. Lines: 23
  12.  
  13.  
  14. I am attempting to learn C++.  I have declared a class called list and class
  15. called generic.  In generic, lspace is declared as:
  16.  
  17. list **lspace.
  18.  
  19. Both g++ and cfront tell me that the line containing new in the following 
  20. constructor has a syntax error.
  21.  
  22. generic::generic() {
  23. this->lrow   = 100;
  24. this->lcol   = 100;
  25. this->lsize  = 0;
  26. this->lspace = new *list[lcol];
  27. this->addrow();
  28. printf("Constructing element\n");
  29. }
  30.  
  31. Can someone tell me what I am doing wrong?
  32.  
  33. Thanks,
  34.  
  35. Jim Nance
  36.