Friday, June 12, 2009

difference between conditional assignment and if else

What is the difference between:
c = check ? a : b;
and
if(check) c = a;
else c = b;

2 comments:

  1. There is no difference when check = 0 or 1. The difference lies when check = x or z.

    ReplyDelete
  2. It's right,you can refine the answer by taking a two bit data assignment.

    ReplyDelete