Array exception
I can't for the life of me figure out this exception. ive identified that it comes from neurons because of it not actually appending the jagged array. Im sure this is something im misunderstanding with C#, maybe something with ownership?
13 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
what you're missing is
.Append
doesn't mutate the source collection, it produces an enumerable that represents the contents of that collection with the appended item at the end
C# arrays can't be resized automatically, if you want that behavior use Lists with .Add
insteadim translating that ot mean its something like python, where 99.9% of functions to change things return the changed value that you then set the original variable equal to
in this specific case with
.Append
, yes
that method is part of LINQ which is a collection of functions to filter/map collectionsi c
so would i have a list of lists of neurons
yes
aight
bet
lists are essentially arrays but they automatically get bigger when you add items
c++ equiv of vector
yeah
and then arrays are basically the same between c# and c++
at least in application
dubs
In C++, array cannot be assigned directly to another array.
But in C#, it is ok.
it would be a more realistic comparison to use pointers
and C# references are more like pointers than stack allocated variables