There is a two-dimensional array of text in which you need to swap the odd lines in a circle. For this, the function transformation1 has been declared, but when this function is called, one of the lines is not in its place.
void Transformation1(char **text, int countofstr){ int i; int mult; char *p; if (countofstr%2==0) mult=(countofstr-2); else mult=(countofstr-1); p=text[mult]; for (i=0; i<mult; i=i+2){ text[i+2]=text[i]; } text[0]=p; } Original text:
abcd
def
ghk
rlh
fhk
eyc
An example of correct execution of the function:
fhk
def
abcd
rlh
ghk
eyc
The transformation1 function is as follows:
fhk
def
abcd
rlh
abcd (!!! wrong string !!!)
eyc