1

I noticed that I do not get a compiler error for the following code. Instead the program hangs. Why is that so?

class GLvector
{
public:
  static GLvector CrossProduct(const GLvector &V1, const GLvector &V2);

// ..

GLvector v;
v.CrossProduct(foo, bar);
dgrat
  • 2,214
  • 4
  • 24
  • 46

1 Answers1

2

It is not necessary to call a static function through an object of your class but you CAN call it through object.

Calling the static function through an object doesn't causes any compiler errors and it also doesn't hangs your program. Program hanging in your case might be because of some other issue.

Yousaf
  • 27,861
  • 6
  • 44
  • 69