Justin_10 <justi_10@xxxxxxxxxxxxxx> writes: > I am doing image processing application in which i will be getting two > things pointer and a memory size pointed by this pointer. > > So for each invocation down the line i have to pass this two parameters. > > Is it possible to know the size of memory from the pointer itself. > > Please suggest for suitable solutions. > > for eg msize on windows. This is actually not a compiler issue. It depends on the code that you are using to allocate memory. Many memory allocators do not record the exact size of the memory block that you request; they only record the size of the memory block that they allocate, which may be larger than the amount you request. That is true of the memory allocator used by glibc on GNU/Linux, for example. So in general there is no way to get this information, unless you use your own memory allocator. Ian