calloc for C++?

It’s recommended to use: double * data = new double[mysize]; in C++ rather than the C-way: double * data = (double *)malloc(sizeof(double)*mysize);

How about the one corresponds to calloc( ) ? Short memo here:
double * data = new double[mysize]();

Search the internet for more details if you are interested …

This entry was posted in programming and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *