Advertisement

Arrays

Started by June 02, 2002 01:50 PM
10 comments, last by Ragadast 22 years, 5 months ago
Yes, arrays in C/C++ start with an index of 0, not 1.
It's not what you're taught, it's what you learn.
The following works for me:

int number[10][7] =
{1,1,1,0,1,1,1
,0,0,1,0,0,1,0
,1,0,1,1,1,0,1
,1,0,1,1,0,1,1
,0,1,1,1,0,1,0
,1,1,0,1,0,1,1
,1,1,0,1,1,1,1
,1,0,1,0,0,1,0
,1,1,1,1,1,1,1
,1,1,1,1,0,1,0};

So, it looks like you can initialize 2-dimension arrays as if it were a 1-dimensional array. I am using MSVC++ 6.0. Maybe this is only available in C++ and not in C? I have no idea. All I know is that it works.

Jason Doucette
http://www.jasondoucette.com/
Jason Doucette / Xona.comDuality: ZF — Xbox 360 classic arcade shmup featuring Dual Play

This topic is closed to new replies.

Advertisement