Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#5

AW: Delphi C++ Dll

  Alt 28. Jan 2019, 08:48
Why even multiply with `count`? The size of the struct is always the same. It only contains a pointer, not the characters themselves.
Nope. It fills the memory described by the pointer with the list elements. In C/C++ int* is basically the same as int[] . The struct size is ofc. the same, but the number of elements in the array might be different each time, so you have to alloc enough space to prevent buffer overrides (thats what happening without the *count).
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat