D
drazbliz
Hello,
I am running the following code segment in visual studio 2005.
size_t cchSize = 10*sizeof(TCHAR);
LPTSTR temp = (LPTSTR)malloc(cchSize);
temp[0] = '\0';
_tcscat_s(temp, cchSize, _T("hello"));
free(temp);
It fails at the statement -
free(temp)
with the error:
Heap block at 00A57F80 modified at 00A57FC0 past requested size of 38.
If i change _tcscat_s to deprecated _tcscat there is no error. Can
anyone throw some light on this?
Thanks,
C++Programmer.
I am running the following code segment in visual studio 2005.
size_t cchSize = 10*sizeof(TCHAR);
LPTSTR temp = (LPTSTR)malloc(cchSize);
temp[0] = '\0';
_tcscat_s(temp, cchSize, _T("hello"));
free(temp);
It fails at the statement -
free(temp)
with the error:
Heap block at 00A57F80 modified at 00A57FC0 past requested size of 38.
If i change _tcscat_s to deprecated _tcscat there is no error. Can
anyone throw some light on this?
Thanks,
C++Programmer.