How do I work with dynamic multi-dimensional arrays in C?

前端 未结 9 1619
庸人自扰
庸人自扰 2020-11-22 05:14

Does someone know how I can use dynamically allocated multi-dimensional arrays using C? Is that possible?

9条回答
  •  -上瘾入骨i
    2020-11-22 06:17

    int rows, columns;
    /* initialize rows and columns to the desired value */
    
        arr = (int**)malloc(rows*sizeof(int*));
            for(i=0;i

提交回复
热议问题