Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Char Array Help

 
Derek Boring
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm making a simple game that uses character arrays as the maps. here's what i have:

key:
x = wall
b = building
w = well
s = store
t = tavern
l,j,f,m = doors to other maps

it tells me that me this:

illegal initializer for char

i don't know why it's telling me this. any and all help is greatly appreciated. thanks guys.
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you have on the right is an array of array of chars, so you need to modify the reference type.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Keith Lynn:
What you have on the right is an array of array[s]...

In other words, what Java calls a "multi-dimensional" array.
 
Mike Mc Afee
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Derek Boring:




If you google "java multidimensional array" you'll find what you need.
[ March 06, 2007: Message edited by: Mike Mc Afee ]
 
Justin Fox
Ranch Hand
Posts: 802
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wouldn't it be char[][] = etc..

?

Justin
 
Derek Boring
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. i can't believe i made such a simple mistake!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic