Thread: stupid compiler

  1. #31
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    did you try the code jlou posted? That should work for sure.

  2. #32
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Yeah.

  3. #33
    Registered User
    Join Date
    Apr 2004
    Posts
    210
    Quote Originally Posted by polonyman
    but it doesn't output dog destructor called once
    This is the output I get:

    Code:
    nyda, nyda/ $ ./test
      Dog Constructor Called
      Dog Constructor Called
      Rover is 0 years old.
      He weighs 0 lbs.
      
      Updating Rover's Age and Weight
      Rover is 1 years old.
      He weighs 10 lbs.
      
      Fido is 0 years old.
      He weighs 0 lbs.
      Setting Fido to be the same as Rover
      Fido is 1 years old.
      He weighs 10 lbs.
      BARK!!
      BARK!!
      Dog Destructor Called
      Dog Destructor Called
    That is with gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6), which should produce about the same code GCC/MinGW does.
    The destructors should be called in any case, no matter what you do with the objects references.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie Problem: Stupid Compiler Error
    By iSlak in forum C++ Programming
    Replies: 4
    Last Post: 08-22-2005, 05:34 AM
  2. Stupid compiler
    By chris1985 in forum C Programming
    Replies: 5
    Last Post: 07-01-2005, 07:22 AM
  3. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:13 AM
  4. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-01-2004, 07:39 PM
  5. Special Compiler for win app's
    By Unregistered in forum Windows Programming
    Replies: 19
    Last Post: 04-26-2002, 03:52 PM