title: Queue pointer and dynamic allocation in c++
body: <p>I have this part of code:</p>
  
  <pre><code>struct IARM_DATA
  {
      IARM_HANDLE handle;
      float position[6];  //May be joint or linear position
      float gripper_opening;
      IARM_LIFT_POSITION lift_position;
      bool foldIn;  //true if foldin and false if fold out
      bool openGripper;
  
      IARM_DATA(IARM_HANDLE _handle, bool _foldIn):handle(_handle),foldIn(_foldIn){}; 
  
      IARM_DATA(IARM_HANDLE _handle, IARM_LIFT_POSITION _lift_position):handle(_handle),
          lift_position(_lift_position){}; //handle, lift_position
  
      IARM_DATA(IARM_HANDLE _handle, volatile float _position[6], float _gripper_opening, IARM_LIFT_POSITION _lift_position):
      handle(_handle),gripper_opening(_gripper_opening), lift_position(_lift_position)
      {
          for(int i=0; i&lt;6; i++)
              position[i] = _position[i];
      }; //handle, position, gripper_opening, lift_position
  
  } ;
  </code></pre>
  
  <p><code>typedef IARM_RESULT (iArmDriver::*singleMvt)(IARM_DATA);</code>  //This is a pointer on an iArmDriver method.</p>
  
  <pre><code>typedef struct {
      singleMvt mvt;
      IARM_DATA data;
  } ONE_MVT;
  </code></pre>
  
  <p>And a queue declaration as this:</p>
  
  <pre><code>std::queue&lt;ONE_MVT&gt; *iarmActions;
  </code></pre>
  
  <p>My question is, i faced an execution problem due to that queue, should I make a dynamic allocation like that:</p>
  
  <p><code>iramActions = (std::queue&lt;ONE_MVT&gt; *)sife0f(std::queue&lt;ONE_MVT&gt; *);</code> ??</p>
  
  <p>Thanks in advance</p>