Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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)];
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #onvert #string #string
ADD COMMENT
Topic
Name
8+3 =