Using binary variables to linearize a non-linear constraint in LPP

I have a constraint that makes the optimization problem nonlinear. The constraint of interest is:

If (a-b)>=0
then c=(a-b)
else
c=0


where $$a$$, $$b$$ and $$c$$ are variables. How to linearize this constraint to convert the problem to linear form?

In other words, you want $$c=\max(a-b,0)$$. If $$c$$ appears in the objective as minimization, you can relax to $$c\ge\max(a-b,0)$$, which is enforced by linear constraints $$c\ge a-b$$ and $$c \ge 0$$.
• My answer suggests replacing the $\max$ constraint with two linear constraints. – Rob Pratt Nov 25 '19 at 13:58