Cannot understand how new or malloc does work with BYTE*
Posted
by chekalin-v
on Stack Overflow
See other posts from Stack Overflow
or by chekalin-v
Published on 2010-03-18T07:37:30Z
Indexed on
2010/03/18
7:41 UTC
Read the original article
Hit count: 573
I trying to allocate memory for 10 bytes
BYTE* tmp;
tmp = new BYTE[10];
//or tmp = (BYTE*)malloc(10*sizeof(BYTE));
But after new or malloc operation length of *tmp more than 10 (i.e. '\0' char not in 10 position in tmp array)
Why?
© Stack Overflow or respective owner