Garbage Values for 2d Array
pawn Код:
`new Float:Race1[][3]={    -1795.0421,1103.3732,45.0752,    -1930.9707,1076.5671,50.9935,    -2230.1987,1076.0427,55.3577,    -2590.9111,1094.3782,56.4249,    -2606.9106,794.0964,48.8295,    -2592.1206,468.0095,14.2402,    -2509.6260,565.3315,14.2450,    -2284.7966,565.8425,34.7950,    -2004.1255,554.2927,34.7953,    -1964.4161,346.3401,33.8492,    -1849.9379,409.4500,16.7912,    -1756.7081,317.2934,6.8105};main(){    for(new PrevCP=0;PrevCP<=race1cp;PrevCP++)        printf("Prevcp = %d, x=%d, y=%d, z=%d",PrevCP, Race1[PrevCP][0], Race1[PrevCP][1], Race1[PrevCP][2]);}`
Код:
```[15:26:20] Prevcp = 0, x=-991927975, y=0, z=0
[15:26:20] Prevcp = 1, x=1149889521, y=0, z=0
[15:26:20] Prevcp = 2, x=1110723841, y=0, z=0
[15:26:20] Prevcp = 3, x=-990814448, y=0, z=0
[15:26:20] Prevcp = 4, x=1149669926, y=0, z=0
[15:26:20] Prevcp = 5, x=1112275288, y=0, z=0
[15:26:20] Prevcp = 6, x=-989109458, y=0, z=0
[15:26:20] Prevcp = 7, x=1149665630, y=0, z=0
[15:26:20] Prevcp = 8, x=1113419337, y=0, z=0
[15:26:20] Prevcp = 9, x=-987631980, y=0, z=0
[15:26:20] Prevcp = 10, x=1149815834, y=0, z=0
[15:26:20] Prevcp = 11, x=1113699097, y=0, z=0
[15:26:20] Prevcp = 12, x=-987566446, y=0, z=0```
It's %f not %d, as you are storing floats into the array.

Forum Jump:

Users browsing this thread: 1 Guest(s)