From the C Standard (6.5.2.4 Postfix increment and decrement operators)
2 The result of the postfix ++ operator is the value of the
operand. As a side effect, the value of the operand object is
incremented (that is, the value 1 of the appropriate type is added to
it).
So the return statement in the function
int chk(int var)
{
return var++;
}
returns the value of the parameter var
before incrementing it. So acrually the postfix incrementing in this return statement does not have an effect and is equivalent to
return var;
That is the function returns the original value of the argument expression.
The function would be more meaningful if for example instead of the postfix increment operator it used the unary increment operator like
int chk(int var)
{
return ++var;
}
In this case the function returns incremented value of the the value of the argument expression.