Arrays
Im confused with arrays. I know what they are but i am confused with using them in loops. Also can someone explain multidimensional arrays to me and how to use them in loops? Any help would be appreciated. This is in C++ by the way.
This is kind of ... unusual. Hopefully it'll help you a little
-Agent1
Edited by - Agent1 on June 10, 2000 10:58:51 PM
#include <stdio.h>#include <stdlib.h>int main(){ int i, j; int array[2][5] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for(i=0; i<2; i++) { printf("###%d###\n", i); for(j=0; j<5; j++) { printf("%d\n", array<i>[j]); } printf("-----\n"); } system("PAUSE"); return 0;}
-Agent1
Edited by - Agent1 on June 10, 2000 10:58:51 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement