Inheritance problem

This is a discussion on Inheritance problem within the C++ Programming forums, part of the General Programming Boards category; I used Inheritance in my program which was compiled by Borland C++ 5.02 compiler in DOS mode. But a runtime ...

  1. #1
    Logic Programmer logicwonder's Avatar
    Join Date
    Nov 2005
    Location
    Kerala, India
    Posts
    52

    Unhappy Inheritance problem

    I used Inheritance in my program which was compiled by Borland C++ 5.02 compiler in DOS mode. But a runtime error occurs and the class object cannot be created. I tried the same program in Win32 mode and everything worked fine. But I need to code in DOS mode since I use BGI graphics in my program.
    Please Help to solve this issue.
    L GIK wins!!!
    Salutes from logicwonder
    Enjoy programming

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Code?
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Logic Programmer logicwonder's Avatar
    Join Date
    Nov 2005
    Location
    Kerala, India
    Posts
    52
    there is no problem with the code since it works in Dev cpp, MSVC and even in Borland C++ (Win32 mode). The question how can I do inheritance in Borland C++ (Dos mode).

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Exaclty the same way, it's a feature of C++ not the particular compiler.

    > there is no problem with the code since it works in Dev cpp, MSVC and even in Borland C++ (Win32 mode).
    Works with "x" but doesn't work with "y" usually points to some problem in your code. Normally of course it works in DOS and fails on a proper OS but the idea is still the same.

    My first impression would be that you're running out of memory in DOS.
    Are you checking all your memory allocations for returning NULL? Your old C++ compiler probably doesn't throw exceptions, and dereferencing NULL isn't immediately fatal.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Logic Programmer logicwonder's Avatar
    Join Date
    Nov 2005
    Location
    Kerala, India
    Posts
    52
    I wrote a small program which impliment inheritance but still the same problem is there. Does Borland C++ (dos mode) does not support inheritance (only Borland C++ (win32) support inheritance)? or do I have to make any configurations in BC++ to make the program run in DOS mode?
    L GIK wins!!!
    Salutes from logicwonder
    Enjoy programming

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Post your small program?

    I don't know the detail of the evolution of C++, but maybe that old fossil compiler is simply too darn old to use anymore.

    > But I need to code in DOS mode since I use BGI graphics in my program.
    Why?
    There are many better graphical APIs out there which are better suited to your OS / 32-bit Compiler / Graphics card.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  2. Multiple inheritance problem
    By Magos in forum C++ Programming
    Replies: 8
    Last Post: 02-21-2006, 08:27 AM
  3. Inheritance using Stack Class Problem
    By dld333 in forum C++ Programming
    Replies: 17
    Last Post: 12-06-2005, 10:14 PM
  4. Replies: 5
    Last Post: 11-07-2005, 10:34 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 04:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21