s->child->count = strlen(name); / use string length / s->child->count++; / increment it /
strcpy(s->name, name); / copy the name into buffer /
s->id = id; / set the integer value /
return s;
/ Free a MyStruct instance and its nested struct / void destroy_mystruct(MyStruct s) free(s->child); free(s);
Note: The code uses `malloc()` for the nested struct rather than allocating it orderFactory->createNew(); $this->stateMachineTransitioner->transiti>productVariantRepository->find(1); $orderItem = $this->orderItemFactory->createNew(); $this->stateMachineTransitioner->transition($orderItem, 'sylius_order_item', 'cart');
`productVariantRepository` retrieves the product‑variant entity.
A new order item is created and also moved into Cart stage.