Packed and unpacked
#include <futurocube>
main()
{
new i
new msg1[]=''hello'' // we are indexing msg1[0]...msg1[1]...
for (i=0;i<sizeof(msg1);i++) printf("_%c",msg1[i]);
printf("\nunpacked string representation in memory\n")
PrintArray(msg1)
printf("\n")
new msg2{}="hello" // we are indexing msg1{0}...msg1{1}...
for (i=0;i<sizeof(msg2);i++) printf("_%c",msg2{i});
printf("\npacked string representation in memory\n")
printf("\n");
PrintArray(msg2)
}
//output is
_h_e_l_l_o_
unpacked string representation in memory
( 0) 00000068 00000065 0000006C 0000006C h...e...l...l...
( 4) 0000006F 00000000 o.......
_h_e
packed string representation in memory
( 0) 68656C6C 6F000000 lleh...oLast updated