How to resolve the algorithm Collections step by step in the FreeBASIC programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Collections step by step in the FreeBASIC programming language
Table of Contents
Problem Statement
Collections are abstractions to represent sets of values.
In statically-typed languages, the values are typically of a common data type.
Create a collection, and add a few values to it.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Collections step by step in the FreeBASIC programming language
Source code in the freebasic programming language
' FB 1.05.0 Win64
'create fixed size array of integers
Dim a(1 To 5) As Integer = {1, 2, 3, 4, 5}
Print a(2), a(4)
'create empty dynamic array of doubles
Dim b() As Double
' add two elements by first redimensioning the array to hold this number of elements
Redim b(0 To 1)
b(0) = 3.5 : b(1) = 7.1
Print b(0), b(1)
'create 2 dimensional fixed size array of bytes
Dim c(1 To 2, 1 To 2) As Byte = {{1, 2}, {3, 4}}
Print c(1, 1), c(2,2)
Sleep
You may also check:How to resolve the algorithm Digital root step by step in the V (Vlang) programming language
You may also check:How to resolve the algorithm Ordered partitions step by step in the Go programming language
You may also check:How to resolve the algorithm Dot product step by step in the Delphi programming language
You may also check:How to resolve the algorithm Least common multiple step by step in the Delphi programming language
You may also check:How to resolve the algorithm Keyboard macros step by step in the Perl programming language