Create a two-dimensional array at runtime: Difference between revisions
Content added Content deleted
No edit summary |
(Added S-BASIC example) |
||
Line 3,191: | Line 3,191: | ||
println!("{}", v[0][0]); |
println!("{}", v[0][0]); |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
=={{header|S-BASIC}}== |
|||
<syntaxhighlight lang="BASIC"> |
|||
var a, b = integer |
|||
print "Two-Dimensional Array Example" |
|||
input "Size of first dimension"; a |
|||
input "Size of second dimension"; b |
|||
dim integer test_array(a, b) |
|||
test_array(1,1) = 99 |
|||
print "Value stored at 1,1 ="; test_array(1,1) |
|||
end |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
Two-Dimensional Array Example |
|||
Size of first dimension? 7 |
|||
Size of second dimension? 7 |
|||
Value stored at 1,1 = 99 |
|||
</pre> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |