Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by tomcr

  1. tomcr

    Constructors and destructors, behaving unexpectedly

    Thanks very much! I had ifile declared as a private (ifstream) member of the class anyway but I guess because I used the line ifstream ifile(input, ios::in); It overloaded the variable (so it was referring to a local ifile) or something and like you said invoked the destructor when it went...
  2. tomcr

    Constructors and destructors, behaving unexpectedly

    I have the following constructor for a class: Cdata::Cdata(char *input) { //Try and open the input file ifstream ifile(input, ios::in); if(!ifile.is_open()) { cout << &quot;The input file didn't open!&quot; << endl; exit(1); } } When I call the constructor...

Part and Inventory Search

Back
Top