|
-
November 29th, 2002, 12:32 PM
#1
stack allocation
Hi,
As far as I know, when allocating an array from heap like that: int var[100];, the array comes set all to 0's.
While when allocating from stack i.e: int *var;
var = new int[100];, I get the array in a (so far) free address space but with the junk that was inside.
1. Is this all true?
2. If it is (and if not as well) how can I allocate from the stack, and have the array "clean" with out the need to go manualy and setting all the array members to 0?
In other words, how can I allocate dinamicaly, fast, and "clean"?
Thanks in advance
Dani.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|