Isn't double[][] equivalent to **double?

前端 未结 9 1486
心在旅途
心在旅途 2020-12-29 02:37

I\'m asking this because my program have two functions to multiply matrices, they multiply only 4x4 and 4x1 matrices. The headers are:

 double** mult4x1(doub         


        
9条回答
  •  清酒与你
    2020-12-29 03:10

    Well I hope I will not turn out stupid here but the notation double [][] is also used when you are addressing a continuous block of memory, while double** is not necessarily continuous.

    I think that is the reason behind the error. Even though you can use the same semantics to access values, they are actually different types.

提交回复
热议问题