A
Amit_Basnak
Dear Friends
Currently we are allocating memory in our code to a Structure with
malloc() function and deallocaing using free()
WF_WU_HANDLE * lclStrWorkunit =
(WF_WU_HANDLE*)malloc(sizeof(WF_WU_HANDLE));
where WF_WU_HANDLE is a Structure.
I would like to use new operator as its a C++ code
as in
WF_WU_HANDLE * lclStrWorkunit;
lclStrWorkunit = new WF_WU_HANDLE; // Allocates the memory
then use
delete lclStrWorkunit; // to deallocate the memory
Can someone please explain new suits better than malloc() ?
Thanks
Amit
Currently we are allocating memory in our code to a Structure with
malloc() function and deallocaing using free()
WF_WU_HANDLE * lclStrWorkunit =
(WF_WU_HANDLE*)malloc(sizeof(WF_WU_HANDLE));
where WF_WU_HANDLE is a Structure.
I would like to use new operator as its a C++ code
as in
WF_WU_HANDLE * lclStrWorkunit;
lclStrWorkunit = new WF_WU_HANDLE; // Allocates the memory
then use
delete lclStrWorkunit; // to deallocate the memory
Can someone please explain new suits better than malloc() ?
Thanks
Amit