title: Storing a string into a Queue, using seperate class definitions, C++
body: <p>I am trying to store a string input (a math equation) into a Queue linked list. To add a character into the Queue, i need to access the Queue function &quot;Enqueue( )&quot; from inside a separate class: the &quot;Calculate&quot; class.</p>
  <p>I keep getting error messages (&quot;Queue': undeclared identifier&quot;) and (&quot;QueObj&quot;: undeclared identifier).</p>
  <p>My code mostly looks like this (removed most unrelated code):</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt; 
  #include &lt;string&gt;
  
  class Calculate                                     // Convert from string to node
  {
      public:
          double Calc(string text)            
          {
              input = text;                           // math notation, user input sent from main()
  
  /* error message here -&gt; */ Queue queObj;       // Queue object created to access Queue functions
  /* error message here -&gt; */ queObj.Enqueue(text); // Enqueues the notation into a Queue
              };
  
          private:
              string input;                           // The input string for the math equation
      };
  
      class Queue 
      {
          public:
              void Enqueue(string queVal)             // Enqueue definitions 
              {
                  // Enqueue instructions
              };
      
              void Dequeue()                          // Dequeue definitions
              {
                  // Dequeue instructions
              };
      
              bool IsEmpty()                          // Queue size check 
              {   
                  // Queue size check
              };
      
          private:
              Node *head = NULL;                      // Pointer for start of queue (set to NULL)
              Node *tail = NULL;                      // Pointer for end of queue (set to NULL)
              friend class Calculate;                 // Friend class allows Calculate to access Queue private data
      };
  
     int main()
      {
        string Eq1 = &quot;1 + 2&quot;;                         // math equation 
        Calculate calcObj;                            // object to access calculate class functions and variables
        calcObj.Calc(Eq1);                            // stores the equation into calculate class
        
        return 0;
      }
  </code></pre>