CPP Array basics
CPP
Download (.zip)
#include <iostream.h>
void main() { int x, y, anarray[8][8]; //declares an array like a chessboard for(x=0; x<8; x++) { for(y=0; y<8; y++) { anarray[x][y]=0;//sets all members to zero once loops is done } } for(x=0; x<8;x++) { for(y=0; y<8; y++) { cout<<"anarray["<<x<<"]["<<y<<"]="<<anarray[x][y]<<" ";//you'll see } } }
|