class A {
A& a;
public:
A(): a(* new A()) {}
};
There is a huge flaw here and before I compiled this code I was hoping that it will fail to compile, But it didn't. At first I felt like I had a big flaw in C++ as it allowed data member pointers of the same kind in a class, but then I realized the flaw was in that it is a recursive function call, which will form an infinite loop. Apart from recursive functions, which other methods do you ppl know about C++?