ISHWAR RATTAN writes: > I was asked by a colleague about the code given below. > I compiles and runs as: > 1. No errors on: AMD64 based Solaris-10 (g++: 3.4.3) > 2. Buserror on SPARC based Solaris-10 (g++: 3.4.4) > after printing the results.. > 3. Segmentation fault on Linux (g++: 4.1.2) after > printing the results.. > > Any pointers will be appreciated. Your default constructor is broken. > template<class T> > smartPtr<T>::smartPtr() > // default constructor > { > *p = T(); > } What does p point to? Andrew.