Memory allocation functions are available in BASIC.not really a "shortcoming" because C has other methods of storing and manipulating binary data, for example a memory block allocated with malloc().
ALLOCATE in FreeBasic.
AllocateMemory and AllocateStructure in PureBasic.
Me somehow managed to call malloc() from code PureBasic.
Code:
Import "" malloc(size)EndImportDebug malloc(100) ; Allocate 100 bytes from memory.For some unknown reason it doesn't work.If you want a pointer to that string (which you may if you want to pass it to an API function, for example) you do that as follows:
Code:
SYS "MessageBoxA" 0, PTR("Text"), PTR("Title"), 0 REM SYS "MessageBoxW" 0, PTR("Text"), PTR("Title"), 0 REM SYS "MessageBoxA" 0, "Text", "Title", 0 REM SYS "MessageBoxW" 0, "Text", "Title", 0Statistics: Posted by Vasian — Wed Apr 02, 2025 4:12 pm