Hi shabbir,
Can you tell me how to check whether memory is allocated or not manually? and also about placement new operator?
Regards,
sharmila
|
Contributor
|
|
| 20Jun2006,19:44 | #11 |
|
Contributor
|
|
| 21Jun2006,03:16 | #12 |
|
Quote:
Originally Posted by sharmila The allocation's size is kept somewhere. new [] probably stashes it just before or after the array. However, it's up to the implementation, so it can do whatever the hell it wants |
|
Contributor
|
|
| 21Jun2006,03:19 | #13 |
|
Quote:
Originally Posted by sharmila Last edited by Aztec; 21Jun2006 at 03:31.. |
|
Go4Expert Founder
|
![]() |
| 21Jun2006,10:27 | #14 |
|
Quote:
Originally Posted by sharmila Quote:
Originally Posted by sharmila Code: CPP
Line #2 creates a pointer place that points to the first byte of this memory. Line #3 essentially just calls the constructor Fred::Fred(). The this pointer in the Fred constructor will be equal to place. The returned pointer f will therefore be equal to place. |
|
Contributor
|
|
| 21Jun2006,11:44 | #15 |
|
Thank you Aztec for responding.
Thank you Shabbir for placement new operator.Till now I did not know that we r having placement new operator also. Thanks once again. Regards, sharmila. |

