🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools.mfc
Article #40

Re: HELP !!! Memory - Allocation

#40
From: Programmer
Date: Sun, 28 Jan 1996 01:54
27 lines
1297 bytes
iti@Jerusalem.netvision.net.il wrote:


: I am using Visual C++ to write a Windows Application - and I am having
: a memory problem. I want to dynamically allocate "nTemp" bytes of memory
: to read in a char string, or the most memory available up to "nTemp" 
: bytes.  

: My questions being:
: 	1. How can I most efficiantly do this?
: 	2. Should I use 
: 			-> pChar = (char*) malloc(nTemp); Or
: 			-> pChar = new char[nTemp];

: Please send any advice you have for me to my EMail address:
: 	iti@netvision.net.il

: Thanks
: Yaakov

Hello:

It is highly recommended using the "new" operator when using C++.
It is both practical and effifienct.


Ronski
Technical Details
Message-ID: <1996Jan28.015441.7082@mcs.drexel.edu>
Path: arc1-ca.pugleaf.net!king.mcs.drexel.edu!urcrawfo
References: <NEWTNews.751.822443462.Postmaster@Jerusalem.netvision.net.il>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
Path: arc1-ca.pugleaf.net!king.mcs.drexel.edu!urcrawfo
From: urcrawfo@mcs.drexel.edu (Programmer)
Subject: Re: HELP !!! Memory - Allocation
Message-ID: <1996Jan28.015441.7082@mcs.drexel.edu>
Followup-To: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
Organization: Drexel University, Dept. of Math. and Comp. Sci.
X-Newsreader: TIN [version 1.2 PL2]
References: <NEWTNews.751.822443462.Postmaster@Jerusalem.netvision.net.il>
Date: Sun, 28 Jan 96 01:54:41 GMT