Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_mem
#4
regarding _Mem, run the following snippet

Code: (Select All)

Dim m As _MEM
Dim As Long i
Dim As _Byte ascii
Dim As String * 80 s

m = _Mem(s)

For i = 0 To 79
    ascii = 33 + i
    _MemPut m, m.OFFSET + i, ascii
Next

Print s

it's clear that the memory allocated to the string s is being addressed, so why do I need to free m which behaves as a pointer to s ?
Reply


Messages In This Thread
_mem - by Jack - 12-31-2024, 09:52 PM
RE: _mem - by DSMan195276 - 01-01-2025, 07:11 AM
RE: _mem - by Jack - 01-01-2025, 09:08 AM
RE: _mem - by Jack - 01-01-2025, 10:01 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:18 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:10 AM
RE: _mem - by Jack - 01-01-2025, 10:27 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:36 AM
RE: _mem - by Jack - 01-01-2025, 10:40 AM
RE: _mem - by SMcNeill - 01-01-2025, 10:45 AM
RE: _mem - by Kernelpanic - 01-01-2025, 11:55 PM
RE: _mem - by DSMan195276 - 01-01-2025, 11:13 PM
RE: _mem - by DSMan195276 - 01-02-2025, 12:27 AM



Users browsing this thread: 2 Guest(s)