Answers for "c how to roll back 2d string change"

C
0

onvert a string into 2d string in c

#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)];
    }
}
Posted by: Guest on January-14-2021

Code answers related to "C"

Browse Popular Code Answers by Language