Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Because it tells you very clearly that it's a 2d array and makes it utterly obvious that you should index it twice to get a value.
Btw, use the var keyword if you don't want to type the type twice -
I am reaching the Hulk State-of-Mind. Just doing the SoloLearn course
int[ ][ ] jaggedArr = new int[ ][ ]
{
new int[ ] {1,8,2,7,9},
new int[ ] {2,4,6},
new int[ ] {33,42}
};
I can't use a double array inside but still have to declare it an int array.
@RememberMe @beegC0de thanks, this makes it bearable -
@Krokoklemme That's amazing O_O .Thanks! I am rushing through the tutorials so I get the basics down and skipping the fucking around part where I would learn this kind of beauty for prototyping.
That's why I love devrant. Newbies and screen tanned pros get together.
Related Rants
I learned a bit of python and started to enjoy programming. The syntax is short and beautiful but because I want to get into AR development I started C# now. The basics were ok but I am going fucking crazy looking at arrays. It's like the time I had to do stuff with Java again. I'd rather get tortured like Theon Greyjoy then writing this clunky garbage. But I really wanna get into AR 😖.
I'd appreciate if someone could give me reasons not to hate this syntax from the bottom of my 💓.
int[ ][ ] ohGodWhy = new int[ ] [ ]
rant
hate love relationship
help me