So, in C / C ++, we create an array of strings as follows.
char ** ptr = new char*[n]; for (int i = 0; i < n; ++i) ptr[i] = new char[m];
As a result, we get n lines of m characters in each line. To move along the line we can use the following construction.
while( ptr[i] != NULL && *ptr[i] != '\0') { // Делаем нечто ++p[i]; }
Essentially, we are looking at whether a line ending character is encountered. We can pass the term to the form without passing its length, and go through all the characters in the string. A question such how to make the similar mechanism for sorting of lines in an array?