Tag Archives: c++

Passing class member function as argument

Here is one example: Declaration: class CDifferentialFFT : public CDifferential {   …   double benchmark(void (CDifferential::*) (float*, float*, int), float* p, float* pz);   … } Implementation: double CDifferentialFFT::benchmark(void (CDifferential::*func) (float*, float*, int), float* p, float* pz) {   … … Continue reading

Posted in programming | Tagged , | Leave a comment

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](); … Continue reading

Posted in programming | Tagged | Leave a comment