Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > 2D Ragged Arrays

Reply
Thread Tools

2D Ragged Arrays

 
 
Shust Shust is offline
Junior Member
Join Date: May 2008
Posts: 1
 
      05-01-2008
I'm trying to create a 2D Ragged Array and I want to use initializer lists without them being nested, but for some reason it won't compile.

I'm attempting:

char[][] symbols = new char[4][];
symbols[0] = {'c', 'm', 'j'};
symbols[1] = {'c', '#', '?', 'w'};
symbols[2] = {'R'};
symbols[3] = {'?', '@'};

First line is okay, but it points me to the first bracket and states:
illegal start of expression

Anyone have any suggestions?
 
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
parallel CRC and ragged words Matt VHDL 9 02-10-2012 05:02 PM
permute each element of a ragged array? Phlip Ruby 17 05-18-2009 04:34 PM
Ragged array whose rows are of varying size er C++ 8 07-05-2008 10:00 PM
Ragged Display - Which Control? Mike Robbins ASP .Net Web Controls 4 10-26-2005 02:30 PM
Face curves looking ragged/pixelly Alfred Molon Digital Photography 6 07-25-2004 08:31 PM



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