How to make access to the elements of the matrix on a double pointer?


    1 answer 1

    Let a pointer to an array be given:

    int *array; 

    Then for the array of dimension [lxwxh] the element at the position (a, b, c) will be accessible by the offset

     element = *(array + a * (w * h) + b * (h) + c) 

    Or through dereference:

     int array[l][w][h]; element = *( *( *(array + a) + b) + c) 
    • I have a task. work with matrices C = 2 (A + B) * B below is a program. I was given the task (1) to find the product of negative matrix elements using a subroutine that returns a value. 2) Access to the matrix matrix as instructed.) Can you fix the code, eh? - Vital
    • five
      @Vital: money for the project in half? - VladD