C語言 – 三元運算子 ( x ? y : z )
資料來源:http://213style.blogspot.tw/2013/01/c-x-y-z.html
val = x ? y : z ;
等價於
if(x == true)
val = y;
else
val = z;
C語言 – 三元運算子 ( x ? y : z )
資料來源:http://213style.blogspot.tw/2013/01/c-x-y-z.html
val = x ? y : z ;
等價於
if(x == true)
val = y;
else
val = z;
本文由 jashliaoeuwordpress 提供 原文連結