Simple: you don't initialise any values.
You create an instance of a Box:
Box b;
but that doesn't assign any value to
length
before you try to use it:
Box b;
cout<<"length of box:"
Different compilers will treat this situation differently: some will zero the memory for you, others will not - so two different compilers (or even just the switches applied when it is compiled) will produce different results.
Since a box can't have no dimensions and still be a box, a default parameterless constructor is probably fairly useless and one that takes a length, depth, and height might be a better idea ...