CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #1
    Join Date
    Nov 2016
    Posts
    24

    dynamic memory allocation for multidimensional arrays

    How can i create a multidimensional array for more than 3 dimension like below:

    Code:
    int dim1, dim2, dim3;
    dim1=10000; dim2=99; dim3=9;
    #define s(i,j,k) (array[dim2*dim3*i + dim3*j + k])
    double * array = (double *)malloc(dim1*dim2*dim3*sizeof(double));
    If someone knows please tell me, i really need this thing.
    Last edited by 2kaud; November 11th, 2016 at 04:28 AM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured