Main Index : Reference :
[int] sizeof([string,bytes,array] object)
object
is a string, byte array or array.
sizeof()
returns the size of object
, that is how many elements there are in it. If object
is not a string, byte array or array the return value is nil
.
// Outputs "sizeof(str) = 12
// sizeof(mem) = 7
// sizeof(arr) = 20"
var str = "Hello World!";
var mem = new(bytes,7);
var arr = new(array,20);
println("sizeof(str) = ",sizeof(str));
println("sizeof(mem) = ",sizeof(mem));
println("sizeof(arr) = ",sizeof(arr));