Re: [linux-audio-dev] A C++ question

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] A C++ question
From: Andy Schmeder (andy_AT_a2hd.com)
Date: Fri Apr 18 2003 - 01:16:46 EEST


<quote who="Nick Tsocanos">
> Sometimes I might make a class, and inherit it from another. Or, the
> class just has virtual functions in it ( I am planning to derive others
> from it). In any case, I am trying to access a virtual function in an
> instantiated instance at runtime, and when I do, the program crashes.
...

You don't give much detail, but here my guess:

Methods of parent classes (other than the constructor) are not available
from within the constructor of derived classes. The object is not
'completed' until after the constructor exits.

See B. Stroustrup's "The C++ Programming Language" for the gritty details.

Dynamic runtime languages (e.g. Python) do not have this problem... so it
might be a bit suprising depending on your background.

--aws

mailto:andy*a2hd,com
http://www.a2hd.com/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Apr 18 2003 - 01:21:44 EEST