home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!usc!wupost!tulane!bourbon!he
- From: he@bourbon.ee.tulane.edu (Chuang He)
- Subject: malloc or new in C++
- Nntp-Posting-Host-[nntpd-21487]: bourbon
- Message-ID: <1992Aug31.194426.21549@cs.tulane.edu>
- Sender: news@cs.tulane.edu
- Organization: E.E. Dept., Tulane University, New Orleans, LA
- Distribution: usa
- Date: Mon, 31 Aug 1992 19:44:26 GMT
- Lines: 17
-
-
- I have written a program by using C++. The compiler is Sun C++ 2.1. I find a
- very interesting thing. I find two structure pointer set by malloc or new have
- the same address. That means if I change the content of one pointer pointing to
- will also change the other's. But these two pointers are unrelated. I don't know
- why. Does this mean that I use too much new or malloc that no more memory I can
- use? Could anyone tell me about how many memories can one program use, I mean
- use by new or malloc. My machine is Sparcsation-SLC. The system is SunOS 4.1.1.
- It would be appreciated that someone can tell me the reason and the solution.
-
-
- Please send me an email. I do not read this newsgroup quite often.
-
- he@bourbon.ee.tulane.edu
-
-
- -Chuang
-