Good day colleagues. Solved a simple problem. Normal for seemed to me too ordinary. I tried to solve the problem using for each , and ... I did not succeed in ๏ ๏.
double x [] = {255, 0 , 212}; for(double g : x) { g = g/255; } At the output, the array remained the same, but I wanted it to be {1, 0, 0.82} .
I understand that in this cycle you can read the values - because g is just a copy.
Question: Is it possible to change the values in this array by the for each loop, so that after exiting the loop, in this example, {1, 0, 0.82} ?