pr1 points to some random place in memory. When that code is encountered it tells to compiler to interpret whatever memory pr1 is pointing to as a linklistchain<int>, and since it isn't a linklistchain<int> bad things happen.