C
C#7mo ago
Ewan

✅ I want to make multiple array variables using a for loop, each with 4 items

But how do i do this?
No description
17 Replies
Ewan
Ewan7mo ago
say i wanted 10 lines, id like 10 variables: person1 person2 all the way to person10 as arrays but how?
Thinker
Thinker7mo ago
That's not a thing
Ewan
Ewan7mo ago
WHAT
Thinker
Thinker7mo ago
You'll have to use nested arrays
Ewan
Ewan7mo ago
could u hint how? im pretty new to C#
Lisa
Lisa7mo ago
An array of arrays basically
Thinker
Thinker7mo ago
string[][]
TheRanger
TheRanger7mo ago
jagged arrays yeah
Ewan
Ewan7mo ago
uhhh ok ill try i guess
TheRanger
TheRanger7mo ago
or multidimensional array but wait the question is, why?
Thinker
Thinker7mo ago
You can actually pretty easily turn your current code into using nested arrays
TheRanger
TheRanger7mo ago
why are u trying to make multiple array variables and what exactly does the 4 items represent?
Ewan
Ewan7mo ago
i have an assignment which requires this 4 items are different things i need, and then i need to order all the arrays from highest to lowest using one of the 4 items
TheRanger
TheRanger7mo ago
sounds like you need to define a class, but if the assignment requires you to do what u said, ig there's no other option
Ewan
Ewan7mo ago
we havent done classes yet tho so it isnt expected welp thanks anyways
TheRanger
TheRanger7mo ago
if they didnt teach you how to define multiple array variables then how do you expect to make one?
Ewan
Ewan7mo ago
idk catshy figure