#include <iostream>
usingnamespace std;
int main ()
{
int *ptr = NULL;
cout << "The value of ptr is " << ptr <<"\n";
if(ptr) cout<<"ptr\n";
if(!ptr) cout<<"not ptr\n";
return 0;
}
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.
1 2 3 4 5 6 7
int main()
{
linklistchain<int> pr1;
cout<<"started";
pr1.insert(5);
return 0;
}