C++ 2D array to 1D array

后端 未结 4 1561
春和景丽
春和景丽 2020-12-17 00:23

I am attempting to convert a 2D array to 1D. I\'m extremely new to C/C++ but I think it\'s very important to learn how to convert a 2D array to 1D. So here I am stumbling u

4条回答
  •  难免孤独
    2020-12-17 01:04

    First of all, the size of the 1D array should be n*m.

    The cycle can be as follows-

    int lim = n*m;
    
    for(q = 0; q

提交回复
热议问题