This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Question about "restrict" keyword with 2D pointer



Hello,

          I defined and allocated two 2D pointer a&b, and I know the way to set them not aliased just as follows:

float** restrict a=(float**)malloc(n*sizeof(float*));

float** restrict b=(float**)malloc(n*sizeof(float*));

          As we know, a[i]&b[i] are also pointers. But I was wondering how to let compiler know that a[i]&b[i] are also not aliased too? I have tried (float* restrict)a[i]=(float*)malloc(n*sizeof(float)) but compiler reported an error..

         Thank you very much for helping me!