I am not getting what the loops are doing in the following function concerning strings:
assume values are called these different ways:::Code:int alpha(char *mom, char *pop) { char *m1, *p1; for (m1 = mom; *m1; m1++) // what is this doing??? { for (p1 = pop; *p1; p1++) if (*m1 == *p1) break; // what does this mean?? if (*p1 == '\0') break; // why break at these points? } return m1 - mom; // what is m1 - mom??? }
alpha("rstu", "wxyz") what is alpha now??
alpha("rstu","wxy") what is alpha now??
i see the one string is shorter
than the other
when alpha is passed both strings mom and pop what does alpha return???
Please just help me get the notation in the for loops
and what happens with the line return m1 - mom ....