Create a two-dimensional array at runtime: Difference between revisions

Updated D entry
m (→‎{{header|Run Basic}}: Language names are case-sensitive and I think lang tag names only take one word)
(Updated D entry)
Line 372:
 
void main() {
int nRow, nCol;
 
write("Give me the numer of rows: ");
try {
int nrow = to!int(readln().strip());
nRow = readln().strip().to!int();
} catch (StdioException e) {
nRow = 3;
writeln();
}
 
write("Give me the numer of columns: ");
try {
int ncol = to!int(readln().strip());
int nrow nCol = to!int(readln().strip());
} catch (StdioException e) {
nCol = 5;
writeln();
}
 
auto array = new float[][](nrownRow, ncolnCol);
array[0][0] = 3.5;
writeln("The number at place [0, 0] is ", array[0][0]);
}</lang>
{{out}}
<pre>Give me the numer of rows:
Give me the numer of columns:
The number at place [0, 0] is 3.5</pre>
 
=={{header|Delphi}}==