News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

create_array

Started by ecube, October 20, 2007, 09:10:51 AM

Previous topic - Next topic

ecube

I was wondering how I can use somthing like this

MYARRY struct
value1  db 255 dup(?)
value2   db 255 dup(?)
value3  db 255 dup(?)
MYARRY ends

in the create_array function and access pointers to many of these structs created on the fly when needed?
                   

u

HeapAlloc those objects one by one in a loop, and put the pointers in an array (of dwords).
Read-up on dynamic allocation of objects (instances of structures) , and dynamic array allocation - search for tutorials in/on C.
Please use a smaller graphic in your signature.

hutch--

cube,

What you do depends on if you know how many items you need or not. If you do know then a single preallocated block of memory is the fastest way to do it. If you don't know then dynamically allocating memory on the fly is how you will have to do it but it is a lot slower on large quantities.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

xfpl

 :dazzled:Hello!,I was wondering why don't you use masm 6.10?

hutch--

With ML.EXE versions anything from version 6.14 upwards will do the job for 32 bit code. 6.10 is in fact a 16 bit DOS version which does not build late 32 bit code.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php