Array Notation for Non-static Memory

Array Notation for Non-static Memory

Can Cilk's array notation be used with arrays that have been allocated dynamically with malloc or new (or any arbitrary pointer)? All of the examples show usage based off of a static array.

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

yes, you can use array notation on dynamically allocated array... for example:

double* time = new double[NUM_OPTIONS];
time[0:NUM_OPTIONS] = 1.1;

- J.D. Patel

登陆并发表评论。