what does -> mean

Well first off let me say hi to everyone, this is my first post on the exciting journey to becoming a c++ programmer.... well im excited anyway- iv been programming in delphi for about 10 years now, so I know the principles, its just to now port them over, but im stuck with trying to interpret a line of code I came across, if someone could point me in the right direction I would appreciate it:

 
local->evaluate( local->data, cmd );

Did you read already about pointers (and classes)?

straight forward -> here means:

(*local).evaluate(...)

what is does is:
local points to a certain object: you "get" that object by doing *local - And now you want that object to execute the "evaluate" memberfunction..
ok i think i get it- so local is a pointer to an object, that contains a function called evaluate,

so im simply calling the evaluate function..... makes sense thanks......
Another Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

class myClass
{
public:
    void myFunc();
};

int main()
{
    myClass one;
    myClass *ptr = new myClass();

    one.myFunc();

    // is equivalent to

    ptr->myFunc();

    delete ptr;

    return 0;
}

Last edited on
Actually with the Lightwave SDK it is a pointer to a struct as C has no OOP capabilities and evaluate() is a pointer to a function LightWave uses.
Last edited on
Topic archived. No new replies allowed.