📜  onvert a string into 2d string in - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:37.300000             🧑  作者: Mango

代码示例1
#define NUM_ARRAYS 2
#define LENGTH 4

char *string = "GOODMORN";

for (arr = 0; arr < NUM_ARRAYS; arr++)
{
    for (idx = 0; idx < LENGTH; idx++)
    {
        array[arr][idx] = string[idx + (arr * LENGTH)];
    }
}