[Solved] How do i select a number in a matrix in c?
If you mean number in a matrix as follows (example for matrixSize == 4): 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 you can just calculate indexes from number matrixValues[number/matrixSize][number%matrixSize] EDIT: For case when your 2D arreay defined as int matrixValues[matrixSize][matrixSize]; All elements allocated in memory sequentially, … Read more