- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
\Dear all,I have following example program which compiled nicely with Intel 12.1 C++ compiler
**********
#include <iostream>
typedef double (*A3)[][];
double sum(int Nx, int Ny, int Nz, double A[Nx][Ny][Nz])
{
double res = 0;
for(int x=0;x<Nx;x++) { for(int y=0;y<Ny;y++) { for(int z=0;z<Nz;z++) {
res += A
} } }
return res;
};
int main()
{
double *a = new double[8*8*8];
std::cout << sum(8,8,8, (A3) a) << std::endl;
};
*********
However, swiching to the 13.0 version, compilation aborts with following error message
icc -o test ArrayTest.cpp
ArrayTest.cpp(3): error: an array may not have elements of this type typedef double (*A3)[][];
Is there any new way how to pass arrays to a function ? Note, that I use this principle for large scale
numerical simulation code, where I have to pass an array over many different functions .
Thanks a lot for any help, Sincerely
Paul
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page