I'm attempting to get the inverse of a matrix using SGETRF, then SGETRI, but I'm running into an error that I can't decipher. My C code is simple, I initialize matrix A[2][2], then call sgetrf_, then sgetri_ but sgetri_ chokes on the third parameter.

Your n value is wrong. It's supposed to be the order of thematrix, which is 2 in your example, not the number ofelements in the matrix. Lapack is choking on the ldaargument, because if the order of the input matrix werereally 4 then an lda of 2 would not be valid.