A function post-condition refers to what will happen and return after calling the function.
Given the function definition as follows:
int SomeFunc( /* in */ int alpha, /* in */ int beta )
{
int gamma;
alpha = alpha + beta;
gamma = 2 * alpha;
return gamma;
}
If we call the function by passing two values, 3 and 4, as input parameters, the 3 will be captured by alpha and 4 by beta. The two input values will by calculated based on the formula defined inside the function as follows:
int SomeFunc( /*in */ int alpha, /* in */ int beta )
{
int gamma;
alpha = alpha + beta;
gamma = 2 * alpha;
return gamma;
}
The post-condition is useful for testing purposes. It represents what value the function SomFunc is expected to return at the time of program execution in a simplified manner.