How to get size of dynamically memory allocated pointer?

  • Thread starter Thread starter sgrm123
  • Start date Start date
S

sgrm123

Guest
Hi,

I am dynamically allocating memory to a pointer using below code.

typedef struct
{
unsigned int * values;
CLOCK time;
} RECORD;

RECORD *pRecords = malloc(sizeof(RECORD)*samples_per_chart);

Wherever I am using pRecords I need to verify the size of pRecords pointer matches with samples_per_chart.

How to get the memory size of dynamically memory allocated pointer?

Continue reading...
 
Back
Top