Passing array to a function (and why it does not work in C++)

后端 未结 7 1447
死守一世寂寞
死守一世寂寞 2020-12-15 15:03

I have come across some C code that compiles, but I do not understand why. Specifically, I have a C library that has a lot of code using this format:

void ge         


        
相关标签:
7条回答
  • 2020-12-15 15:59

    All that it does (in C) is allow you to write indexing code in the called funcion without having to do the address calculation yourself, for example:

    double d= xu_col[i*row_size + j]; //get element [i,j]
    

    versus

    double d= xu_col[i][j];
    
    0 讨论(0)
提交回复
热议问题