I need to sort a given 2d array (char crossword[40][20]) by lines with lexicographical sort.
the crossword[40][20] contains:
TYPE
GUITARIST
VAIN
ROME
MARRIAGE
NOODLE
ANT
IN
PETROL
CUT
LIE
ATOM
MOUTH
ENVELOPE
IN
AT
AGE
ART
INTERIOR
AT
ROBBERY
AT
AIR
STIR
NO
IT
SMILE
NIGHT
ACE
MANDATORY
TO
NY
DO
OZONE
ON
UNDERWATER
NOUN
so crossword[0][columns]=TYPE, crossword[1][columns]=GUITARIST etc.
and must be converted to lexicographical order like that:
ACE
ANT
...
...
...
VAIN
Of course i know how to bubblesort a 1d array but what happens with 2d like the above?
I want only the lines so the letters of the words stay as they are.
I would appreciate if the code contains the strcmp.