Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 08:26, 29 February 2024
, 3 months ago→{{header|Objeck}}
Line 2,413:
rows := Standard->ReadLine()->ToInt();
cols := Standard->ReadLine()->ToInt();
array := Float->New[rows, cols];▼
array[0,0] := 42.0;▼
if(rows > 0 & cols > 0) {
Standard->Print("The number at place: ")->PrintLine(array[0,0]);▼
▲ array := Float->New[rows, cols];
▲ array[0,0] := 42.0;
▲ Standard->Print("The number at place: ")->PrintLine(array[0,0]);
}
}
}
|