| hydra89 (3) | ||||||
The program is not taking in the value the user input for 1 of the attribute.
However, my program takes in x4 with the values of y1.
If I change the value of y1 to another value, x4 is changed automatically. May I know why is wrong with my codes? | ||||||
|
Last edited on
|
||||||
| pogrady (411) | |
| Can we see your output code? | |
|
|
|
| hydra89 (3) | ||
|
Thank you for the reply. This is the output code for square s("square",false,1,2,3,4,1,2,3,4);
Everything works perfectly when i change the array size to x[4] but i cannot get the reason why. | ||
|
|
||
| nixer526 (17) | |||
The problem is with this
Although computers read from 0, but when declaring, it doesn't start from 0. What I mean is that arrays are like x[0] ~ x[3], but when declaring int x[4] because there will be 4 memory being used. | |||
|
|
|||
| hydra89 (3) | |
|
Okay! I get it now. Thanks nixer526 for the explaination :) | |
|
|
|