[CLN-list] how to locate arrays in CLN library

Bruno Haible bruno at clisp.org
Fri Jun 19 22:45:36 CEST 2009


Richard B. Kreckel wrote:
> You could either read up on the C++ feature "placement new" or, better, 
> simply use C++ standard containers instead of malloc'ed memory.

Or, simpler than that, use normal arrays:

       A = new cl_N[N];
       for(i=0; i<N; i++) {
               A[i] = complex(cl_float(i),cl_float(2));
       }
       for(i=0; i<N; i++) {
               cout << A[i] << endl;
       }

Bruno



More information about the CLN-list mailing list