Hi andy,
While helpful, sergent and mike missed the original problem: your main() failed to call p1.setDistFrOrigin() before printing it, so you were getting whatever garbage happened to be in that memory location.
Also, if I recall correctly, since pow() is written to support non-integer exponent values, it's not necessarily very efficient. For Point2D, just use sqrt(x*x + y*y), and for Line2D, consider using a couple of temporary values to make your expression more readable.