I am trying to understand what happens when indexing through an array with a float value.
This link: Float Values as an index in an array in C ++
Does not answer my question, as it claims that the float should be rounded to an integer. However, in the code I'm trying to evaluate, this answer does not make sense, since the index value will always be only 0 or 1.
I am trying to solve a coding problem sent by Nintendo. To solve the problem, there is an archaic instruction that uses bitwise assignment in an array using a long complex bitwise expression.
An array is declared as a pointer
unsigned int* b = new unsigned int[size / 16]; // <- output tab
Then it assigns 0 to each element.
for (int i = 0; i < size / 16; i++) {
b[i] = 0;
}
Here is the beginning of the instructions.
b[(i + j) / 32] ^= // some crazy bitwise expression
.
, . , , .
, float, int. .