I am reading a code of my friend an I see this:
#include
#include
void main()
{
char string1[125], string2 [10];
in
The ;
is just a null statement, it is a no op but it it the body of the while loop. From the draft C99 standard section 6.8.3
Expression and null statements:
A null statement (consisting of just a semicolon) performs no operations.
and a while statement is defined as follows from section 6.8.5
Iteration statements:
while ( expression ) statement
So in this case the statement of the while loop is ;
.
The main effect of the while loop is here:
string1[i++] == string2[j++]
^^^ ^^^
So each iteration of the loop increments i
and j
until the whole condition:
string1[i++] == string2[j++] &&string1[i-1] != 0 && string2[j-1] != 0
evaluates to false
.