C
C#12mo 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
EwanOP12mo ago
say i wanted 10 lines, id like 10 variables: person1 person2 all the way to person10 as arrays but how?
Thinker
Thinker12mo ago
That's not a thing
Ewan
EwanOP12mo ago
WHAT
Thinker
Thinker12mo ago
You'll have to use nested arrays
Ewan
EwanOP12mo ago
could u hint how? im pretty new to C#
Lisa
Lisa12mo ago
An array of arrays basically
Thinker
Thinker12mo ago
string[][]
TheRanger
TheRanger12mo ago
jagged arrays yeah
Ewan
EwanOP12mo ago
uhhh ok ill try i guess
TheRanger
TheRanger12mo ago
or multidimensional array but wait the question is, why?
Thinker
Thinker12mo ago
You can actually pretty easily turn your current code into using nested arrays
TheRanger
TheRanger12mo ago
why are u trying to make multiple array variables and what exactly does the 4 items represent?
Ewan
EwanOP12mo 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
TheRanger12mo 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
EwanOP12mo ago
we havent done classes yet tho so it isnt expected welp thanks anyways
TheRanger
TheRanger12mo ago
if they didnt teach you how to define multiple array variables then how do you expect to make one?
Ewan
EwanOP12mo ago
idk catshy figure
Want results from more Discord servers?
Add your server