Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to malloc for matrix in c

int** mat = (int**)malloc(rows * sizeof(int*))

for (int index=0;index<row;++index)
{
    mat[index] = (int*)malloc(col * sizeof(int));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #malloc #matrix
ADD COMMENT
Topic
Name
3+8 =