Horje
dynamic 2d arr in c Code Example
dynamic 2d arr in c
#include <stdio.h>
#include <stdlib.h>

int main(void){
    int i, j, col = 3, row = 4;

	/* create dynamic 2d arr (matrix) */
  
    int **m = (int**)malloc(col * sizeof(int)); 
    for(int i = 0; i < col ; i++){
        m[i] = (int*)malloc(row * sizeof(int));
    }
  	
  	/* after usage free it */
  
    for (int i = 0; i < row; i++){
        free(m[i]);
    }
    free(m);
}




C

Related
c get file size Code Example c get file size Code Example
get_session` is not available when using TensorFlow 2.0. Code Example get_session` is not available when using TensorFlow 2.0. Code Example
add border to image android Code Example add border to image android Code Example
Using PostgreSQL array to store many-to-many relationship using sqlalchemy Code Example Using PostgreSQL array to store many-to-many relationship using sqlalchemy Code Example
types of instruction and there meaning in c Code Example types of instruction and there meaning in c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9