how to sort a 2d array of strings alphabetically in c?
I assume that you mean an array of strings by “2d array of strings”.
In that case, use string compare function “strcmp()” in the place of ‘>’ or ‘<’ sign in your sort function.
1 Like
But how you want to sort 2D array?
What should be the result for:
String[][] sa = {
{ "A", "C" }
{ "B", "D" }
}
it’s Java syntax, but still should be clear what I meant…