Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Setting up two dimensional array valuea

Reply
Thread Tools

Setting up two dimensional array valuea

 
 
streamkid@gmail.com
Guest
Posts: n/a
 
      12-01-2006
Hello...
i have a two dimensional array of ints,
int board[ 8 ][ 8 ];

when i try to set each element, like that
board[ 7 ][ 7 ] = { blcaslte, blhorse, blbishop, blking, blqueen,
blbishop, blhorse, blcastle,
blpawn, blpawn, blpawn, blpawn, blpawn, blpawn,
blpawn, blpawn,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
whpawn, whpawn, whpawn, whpawn, whpawn, whpawn,
whpawn, whpawn,
wcastle, whorse, wbishop, wking, wqueen,
wbishop, whhorse, whcastle };

ofc i have enums,
enum pieces { blcaste = 1, blhorse = 2, blbishop = 3, blking = 4,
blqueen = 5, blppawn = 6,
whcaslte = 7, whhorse = 8, whbishop = 9, whqueen = 10,
whking = 11, whpawn = 12,
null = 0 };

but i also tried with this
const int blcaste = 1;
const int blhorse = 2;
etc..

but this didn't work either..

any idea anybodi??

 
Reply With Quote
 
 
 
 
streamkid@gmail.com
Guest
Posts: n/a
 
      12-01-2006
just ignore typos, that's not the code, i wrote it to post it because i
don't have the code available atm

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To convert a one dimensional array into a two dimensional array using C amrutha0303 Software 0 08-03-2010 10:02 PM
How do copy Strings from a single dimensional array to double dimensional array Venkat C++ 4 12-05-2003 09:23 AM
Re: Two dimensional pointers and Two dimensional arrays Icosahedron C++ 8 08-21-2003 05:15 AM
Re: Two dimensional pointers and Two dimensional arrays John Harrison C++ 4 08-19-2003 04:00 PM
Re: Two dimensional pointers and Two dimensional arrays Alf P. Steinbach C++ 0 08-18-2003 08:25 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57