(struct) ( class -- struct )
Factor handbook > C library interface > Struct classes > Creating instances of structs

Prev:memory>struct ( ptr class -- struct )
Next:(malloc-struct) ( class -- struct )


Inputs and outputs
classa class
structa struct

Word description
Allocates garbage-collected heap memory for a new struct of the specified class. The new struct's slots are left uninitialized; in most cases, the <struct> word, which initializes the struct's slots with their initial values, should be used instead.

See also