Correct use of "this"? (now with "Normalize()")

Started by
11 comments, last by ToastFlambe 18 years, 8 months ago
Now I have a new (but related) problem. I modified my Vector2 class to use the implementation you guys suggested and it compiles fine. However, when I try to use the Normalize function in my test program, I get a compiler error:

70 C:\Dev-Cpp\Projects\VectorTest.cpp statement cannot resolve address of overloaded function

here is the new normalize function:
Vector2 & Vector2::Normalize(){    *this /= GetLength();    return *this;  }


In the program, I use it by simply writing

temp.Normalize();

by itself. I also have a "Rotate" function that returns a reference to *this and using it in the way above causes no problems.
Advertisement
You didn't forget the () did you?
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
.........:( yes.

This topic is closed to new replies.

Advertisement