Hello all,
I have a question regarding the C++ operator -> What does it do? Can somebody please help me understand it more clearly. If possible can you also guide me with an online link or two to further my understanding of the subject.
Thanks
Hello all,
I have a question regarding the C++ operator -> What does it do? Can somebody please help me understand it more clearly. If possible can you also guide me with an online link or two to further my understanding of the subject.
Thanks
Can you be a little more clear? That is used for normal pointer dereference and also can be overloaded to create "smart pointers", forwarding tasks from "envelope" to "letter" classes, not to mention for whatever else you may think of...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
If you want a link, then try a search....if you want a book, then invest in More Effective C++ by Scott Meyers....he devotes a chapter to smart pointers and describes how to overload operator* and operator-> and what you should/shouldnt do when doing so
These two statements are often equivalent:
Code:a->b; (*a).b;
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling