Hi all,

I want to use a dynamic buffer in one of my application. I'll explain it in this way. Depend on one of my calculation I found a number(int value), and I want to define a buffer size to that value. Then after doing all the required process need to clear that buffer size and define it to the next calculated size. Simply it is looping.

So how can I do it.

Thanks.

Look up new and free .

Like this

char * dataBuffer = NULL ;
dataBuffer = new char[dynamic_buffer_size] ;
// work on with buffer
delete [] buffer;

Look up new and free .

Sorry. new and delete .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.