delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/09/17:00:43

From: am898 AT chebucto DOT ns DOT ca (Blake McCurdy)
Newsgroups: comp.os.msdos.djgpp
Subject: Inheritence lost in multiple files
Date: 9 Jun 1998 20:59:37 GMT
Organization: Chebucto Community Net
Lines: 59
Message-ID: <6lk7np$pld$2@News.Dal.Ca>
NNTP-Posting-Host: chebucto.ns.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

This problem really has me stumped. Take alook at the code and see if you
can explain the error at the end.

This is my own code, I'll just change the class names.

//In foo.h

class foo
{
	public:	foo();
	protected:
			int foosint;
};

//in foo.cpp

#include "foo.h"

foo::foo()
{
	foosint = 0;
}

//in bar.h

#include "foo.h"

class bar : public foo
{
	public:	foo();
};

//in bar.cpp

#include "bar.h"

bar::bar()
{
	foosint = 4;
}

This creates the error:

Error: member 'foosint' is a protected member of class 'foo';

Somewhere in the multiple files, the compiler lost the inheritence.

By the way, I use DJGPP w/ RHIDE.

Any help welcome.

--
_______________________________________________________________________
|								      |
|								      |
| 	   "So then I said 'No, Juan, it's the rice!!' "	      |
|								      |
|_____________________________________________________________________|

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019