JC> This doesn't actually reduce the amount of memory you're using, but it
JC> DOES change the place that it gets allocated, at least on most DOS
JC> compilers. Under DOS, you're limited to the stack occupying 64K, which
JC> leave roughly 580K of other memory you can use for other purposes. When
JC> you use malloc or new to allocate space, it comes out of the rest of the
JC> memory, leaving your 64K stack alone. (Obviously your program occupies
JC> some of that space, but using new/malloc you might still be allocating
JC> out of a pool of 500K instead of a pool of 64K.
So I would put the new when I declare it?
//Excluding structure definition for space
int main(void) {
maptile *local_map = new maptile[9][21];
}
or could I just put:
maptile new local_map[9][21];
I have the program working with the memory now...just gets mixed up
sometimes, I am wondering if that is because I only use the 64k stack
space...Maybe this way it will keep it straight.
Thanks alot for the help! Since I am writing this message, might as well
include this too, Turbo C++ doesn't come with Turbo Assembler does it? Does
it come with an Assembler at all? I have a book on Serial communications in
C/C++ that has assembly code, but my version of Turbo C++ doesn't have it.
If it should, then I got ripped, since I bought it at a software
store...Egghead I believe.
Well, thanks for the input.
Steve Westcot
--- FMail 1.0g
---------------
* Origin: Where It's At BBS, Kimberly, WI (414)788-8050 (1:139/615)
|