How do I pass this function if

int &pos(void) - returns the element at "position" by reference

my method in class definition:
int &pos(void):

my function is

int dequeint::&pos(void)
               {
               return CurrPos->x;
               }         
                NodeValueType dequeint::front()
                    {
                     return headi->x;
                    }

but i get this compiler error expected unqualified-id before "&" token
Many thanks!

& applies to the type, not the name:

int& dequeint::pos(void)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.