Mail Archives: djgpp/1999/04/01/19:54:03
Willem D wrote:
>
> In article <922852481 DOT 604485 AT neptune DOT uniserve DOT ca>,
> "DarkSun" <basicvengance AT hotmail DOT com> wrote:
[...]
> > I see your problem... try changeing the prog to this :
> > #include <iostream.h>
> > #include <string.h>
> >
> > class sorry{
> > public:
> > const char *error_msg;
> > sorry( const char *p) : error_msg(p) {}
> > };
> >
> > int main()
> > {
> > try {
> > throw sorry( "test 3");
> > }
> > catch ( sorry stuff ) {
> > cerr << "Sorry, ";
> > cerr << stuff.error_msg ;
> > cerr << '\n';
> > }
> > cout << '\n';
> > }
I did, it gets the same warning message on the same line.
> Hi DarkSun, The difference between a class and a struct is nada! Although, I
> agree fully with you - and use the class keyword in these instances - it
> seems to be a matter of preference. Maybe someone knows what the ANSI C++
> standard specifies -- can a struct have functions according the the standard?
Bjarne Stroustrup's book The C++ Programming Language Third Edition
says, "A _struct_ is simply a _class_ whose members are public by
default."
at the top of page 226.
Thus:
class X {
is equivalent to this:
struct X {
private:
and:
class Y {
public:
is equivalent to this:
struct Y {
> BTW: Your proposed fix does not work, Dennis' problem remains. It looks like
> a bug to me, albeit a small one.
Yup.
What is the proper place to report bugs?
I have a couple more cases of incorrect
warnings being generated that I would like
to report.
Dennis
- Raw text -