Questions tagged [array]
An array is a systematic arrangement of similar objects, usually in rows and columns.
223 questions
16 votes
10 answers
5k views
C#'s Aversion to Array
I have noticed in documentation, looking at open-source code bases, and just a general sense in the industry that C# developers largely prefer to use List<> or IEnumerable<> over simple ...
0 votes
1 answer
242 views
Elegant way in C to store many parameters with default value and current value in embedded flash
I'm programming an embedded system that has a number of user configurable parameters, which are stored in flash memory. I have to store a default value for each parameter as well as the user settings. ...
27 votes
6 answers
28k views
How can Rust be "safer" and "faster" than C++ at the same time?
I have been told that Rust is both safer and faster than C++. If that is true, how can that be even possible? I mean, a safer language means that more code is written inside the compiler, right? More ...
4 votes
4 answers
1k views
When should tuples be used as an argument instead of an array?
I hope this isn't too off-topic/opinion-based, I'm new here. I want to pass three elements of the same type into a function. The three elements are unique cards of a deck of cards, so they're not ...
7 votes
2 answers
4k views
Why does C not support direct array assignment?
In C you cannot assign arrays directly. int array[4] = {1, 2, 3, 4}; int array_prime[4] = array; // Error At first I thought this might because the C facilities were supposed to be implementable with ...
4 votes
2 answers
2k views
Multidimensional vs nested arrays
A seemingly basic question here. Is there anything you can do with multidimensional arrays that you can't do with nested arrays? Many languages have been designed with both facilities and syntactical ...
0 votes
0 answers
166 views
Best choice for a holding large number of objects in java
I have a set of array, containing a large number of objects (products), which has lately grown so large, searching in it takes about a minute, which is considered too long, since one search is ...
2 votes
1 answer
2k views
Do C++ compilers optimize/pack small data types (e.g. boolean values)?
This occurred to me when looking at stencil computations in numpy. This python library compiles compute-intensive components, so I believe that it's a valid example. Here making selections on an array ...