home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12651 < prev    next >
Encoding:
Text File  |  1992-08-20  |  796 b   |  33 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!sunic!ericom!falcon!jonas
  3. From: jonas@beppe.ericsson.se (Jonas Nygren)
  4. Subject: con/destruction of fundamental type
  5. Message-ID: <1992Aug20.161921.11717@ericsson.se>
  6. Sender: news@ericsson.se
  7. Nntp-Posting-Host: falcon.ericsson.se
  8. Reply-To: jonas@beppe.ericsson.se
  9. Organization: Ericsson Telecom AB
  10. Date: Thu, 20 Aug 1992 16:19:21 GMT
  11. Lines: 20
  12.  
  13.  
  14. I am trying to manage memory allocation, con- and destruction in my own code.
  15. I also want these operations to work for struct/classes as well as fundamental
  16. types, int, char aso. 
  17.  
  18. I have tried this small example with both HP and Sun CC but both claim
  19. than con/destruction as defined is illegal.
  20.  
  21. main(){
  22.   int i, *p = &i;
  23.  
  24.   p->int::int(1);
  25.   p->int::~int();
  26. }
  27.  
  28. How do you do this in C++?
  29.  
  30. /jonas
  31.  
  32. H
  33.