2D Ragged Arrays

Joined
May 1, 2008
Messages
1
Reaction score
0
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top