title: How to delete a dynamic array of structs (C++)?
body: <p>I am building a class that that allocates a dynamic array of structs and the array of structs contains another struct.
  The thing is all the elements in the struct are of fixed size so would the conventional way of releasing the memory suffice (delete [ ] array)?</p>
  
  <pre><code>struct TRANSITION
  {
      int transition;
      int next_state;
  };
  
  struct state
  {
      int transitionCount = 0;
      string stateName;
      string stateAction;
      TRANSITION transitions[50];
  };
  </code></pre>
  
  <p>class constructor/destructor:</p>
  
  <pre><code>FSM(int n)
  {
      numberOfStates = n;
      states = new state[numberOfStates];
      currentState = 0; //First state numbered state 0
      stateCount = 0;
  }
  ~FSM() { delete[]states; };
  </code></pre>
  
  <p>Is this the correct way to delete this array?</p>