Simon Dean writes: > SDAQ::SDAQ(Int_t run, TCanvas *canvas = 0, Cratemap *cratemap = 0) > { > if (canvas) fCanvas = canvas; > if (cratemap) fCrateMap = cratemap; > cout << "numHDI is " << numHDI << " before default constructor" << endl; > SDAQ(); // <--------Default constructor > cout << "numHDI is " << numHDI << " after default constructor" << endl; > fillRuns(run); > } Calling the default constructor like you are doing isn't doing what you think it is (at least, that is, if you are trying to do what I think you are trying to do). What you are doing is creating, but not saving, a default SDAQ which is unrelated to the non-default one you are in the process of creating. If you want to set a bunch of data members to some default values in more than one constructor, instead create a private method, say "Init()" which does this for you and then call this method in all constructors. Also, although unrelated, you don't set the default values for method args (ie. canvas=0, cratemap=0) in the implementation of a method, only in the class definition. Cheers, -Brett.
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:48 MET