Struct with array of structs of unknown size

后端 未结 5 536
臣服心动
臣服心动 2021-02-05 12:35

I\'ve been trying to wrap my head around this the whole day...

Basically, I have a struct called State that has a name and another one called StateMachine with a name, a

5条回答
  •  广开言路
    2021-02-05 13:03

    State ** states;
    

    will create an array of state arrays.

    I haven't read through the whole solution truthfully (gotta run), but you mentioned wanting an array of states - did you possibly want to do:

    State* states
    

    or

    State states[size];
    

    instead? Just food for thought, chances are it wasn't your problem since I didn't fully read it :p

提交回复
热议问题