标签: arduino
你能告诉我这条线是什么意思吗?
char next =(i == TERRAIN_WIDTH-1)? newTerrain:terrain [i + 1];
答案 0 :(得分:3)
相当于:
char next; if ( i == (TERRAIN_WIDTH - 1) ) { next = newTerrain; } else { next = terrain[ i+1 ]; }
更多信息:https://en.wikipedia.org/wiki/%3F: