Method header that I don't know it.

Hi guys,

I am new here.

I saw a thing in c++ that I never saw in before, so if someone know this please explain to me what it is.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

This is the teste.h

class testeClass:
{
    public:
        teste();
        ~teste();

        void mymethod(AnotherClass & p);

};

This is the teste.cpp

testeClass::teste(AnotherClass & p)
{
    AnotherClass::m1 * M1 = p.mx.p( 0 );

    //Here the code that uses M1 variable.
}


My doubt is, what means the operator & in this context, I never saw it in this position.

Thank you in advance.

Last edited on
The & means a 'reference', they are explained here: http://cplusplus.com/doc/tutorial/functions2/
Thank you Galik for your prompt answer.

I understood now, so simple.

tcpbox

Topic archived. No new replies allowed.