Multiple headers, how to use function on Object : <p>How do I access a variable or typedef in a header from a method? It seems that the typedef isn't global even though I included the header file, why?</p>

<p>I have the following situation:</p>

<h1>Snake.h</h1>

<pre><code>#ifndef SNAKE_H
#define SNAKE_H
#include &lt;utility&gt;

class Snake {
public: 
    Snake(int difficulty, int posX, int posY) : difficulty(difficulty) {
        position.first = posX;
        position.second = posY;
    }
    inline std::pair&lt;int,int&gt; const getPosition() {
        return position;
    }

private: 
typedef std::pair&lt;int, int&gt; Point;
    Point position;
};

#endif // !Snake.h
</code></pre>

<h1>Movement.cpp</h1>

<pre><code>#include "Movement.h"
#include "Snake.h"

Snake moveDown() {

    Point dummy = SnakeObject.getPosition();
    return .....;
}
</code></pre>

<p>Now obviously this doesn't compile since there is stuff missing, but the compiler fails to recognize the Point type in the Movement.cpp file.
Also, do I need a Snake pointer in the Movement.h so I can use the snake object to call getPosition?</p>

<p>I'm sorry for the vague description, also your help is much appreciated.</p>
