2D Array Pointer Syntax - C -
i'm new c , our professor has given performance assignment have manipulate 2d arrays. i'm trying figure out how correctly move value between 2 arrays. believe using *(array*i+j) might speed things cannot compile. aware array[i][j] acceptable need fast possible. problem line like
out[x] = *( *(in+i) + j);
the error i'm getting "incompatible types when assigning type int[10000] type int. should making pointers out , in? not allowed change implementation is
define n 10000 /* input matrix */ long in[n][n]; /* output matrix */ long out[n][n];
i answer depressingly obvious none of changes have worked. want change value @ out[x] or out+x.
try this
out[column][row] = *( *(in+i) + j);
you forgetting index 2nd dismension of array assgining to.
Comments
Post a Comment