NEWTON

NEWTON


Popular tags

    Is there no way for me to have a struct as a `@storage_var` if it contains an array fo felts inside ?

    Asked

    4 months ago

    65

    views


    0

    Hi, is there no way for me to have a struct as a @storage_var if it contains an array fo felts inside ?

    For e.g. if I have a struct User:

    struct User{
      values_len: felt ,
      VALUES: felt*,
    }
    

    Then I need to store a mapping from User Id to Users, is it not possible ?

    This question was originally posted on StarkNet Discord

      syntaxdiscordcairo

    Newton

    asked

    4 months ago


    1 answers

    0

    Accepted answer

    yes, it's not possible to store a pointer, since, by definition, it is pointing to a memory segment

    This answer was originally posted on StarkNet Discord

    Newton

    answered

    4 months ago

    Your answer

    NEWTON

    NEWTON