我无法得到那条线

时间:2015-12-23 20:32:19

标签: arduino

你能告诉我这条线是什么意思吗?

  

char next =(i == TERRAIN_WIDTH-1)? newTerrain:terrain [i + 1];

1 个答案:

答案 0 :(得分:3)

相当于:

char next;
if ( i == (TERRAIN_WIDTH - 1) ) {
    next = newTerrain;
} else {
    next = terrain[ i+1 ];
}

更多信息:https://en.wikipedia.org/wiki/%3F: