Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

C/C++ • Re: Two-dimensional array of character strings in C

$
0
0
This looks wrong:

Code:

char * mylist[maxlnnum][maxstrlen];
That's a 2D matrix of pointers.
Remove the * to make it a 2D matrix of characters.

Another way is an edge vector:

Code:

char *mylist[maxlnnum];mylist[n] = strdup("A1,A2,A3,A4");

Statistics: Posted by jahboater — Sun Feb 04, 2024 1:36 pm



Viewing all articles
Browse latest Browse all 8609

Trending Articles