Tag: charat

如何检查char数组是否有空单元格,以便在其中打印0?

码: public void placeO(int xpos, int ypos) { for(int i=0; i<3;i++) for(int j = 0;j<3;j++) { // The line below does not work. what can I use to replace this? if(position[i][j]==' ') { position[i][j]='0'; } } }