473,386 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inheritance with pointers:Overloading?

my one base class is a linklist class.now i'd like to inherit it by
another class.The problem is that when i use the derived class i can't
access the base class's pointers.classic type mismatch.how do i link
the derived class if i can't compare the derived class's pointers to
the linklist class's pointers?
do i do it with overloading?i tried that,but could get it to work.my
handbooks (all 4 of them) has no example on how to do overloading.can
someone help?e-mail if you want to.please, i'm on a deadline!!!
Jul 22 '05 #1
1 1740
Katie wrote:
my one base class is a linklist class.
You have defined a class called "linklist". OK.
now i'd like to inherit it by
another class.
You want to define another class, derived from "linklist". OK.
The problem is that when i use the derived class i can't
access the base class's pointers.
Now you've lost me. Why not? What pointers? How do you "use"
the derived class?
classic type mismatch.
What?
how do i link the derived class if i can't compare the derived
class's pointers to the linklist class's pointers?
What does it mean to "link" a class?

You _can_ compare a base class pointer and a derived class pointer
for equality. Did you use two equals signs, like `=='?
do i do it with overloading?
I shouldn't think so. Without knowing more about the
problem it's impossible to say for sure.
i tried that,but could get it to work.
Right.
my handbooks (all 4 of them) has no example on how to do overloading.
Borrow or buy a better book. There are reviews on the ACCU site.
More recent reviews are more useful because the way people use C++
has evolved. "The C++ Programming Language", 3rd/Special edition,
by Bjarne Stroustrup, covers the whole language nicely. I don't know
that it's very suitable for a beginner.
can someone help?
I tried, really. I don't understand what you are trying to do.
Can you show us the program you are trying to compile?
e-mail if you want to.
Post here, read here.
please, i'm on a deadline!!!


Good luck with that.

--
Regards,
Buster.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Terje Slettebų | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP...
7
by: Katie | last post by:
my one base class is a linklist class.now i'd like to inherit it by another class.The problem is that when i use the derived class i can't access the base class's pointers.classic type mismatch.how...
2
by: Maurice Termeer | last post by:
suppose i've got the following: class a { public: virtual void f(int a); }; class b : public a { public: void f(int a, int b);
12
by: Steve Jorgensen | last post by:
The classing Visual Basic and VBA support for polymorphism, let's face it, is a bit on the weak side, and built-in support for inheritance is non-existent. This little essay is about some patterns...
6
by: Massimo Soricetti | last post by:
Hello, recently I wrote a little class which has to wrap two different type of data, showing the same external interface. I used operator overloading, but the same result I could eventually...
2
by: Tom Smith | last post by:
I'm having difficulty with overloading ==, and it's making my brain melt - can you help...? What I want to have is: 1) A base class A with virtual operator== defined (no problem) 2) A class B...
5
by: toton | last post by:
Hi, I want a few of my class to overload from a base class, where the base class contains common functionality. This is to avoid repetition of code, and may be reducing amount of code in binary,...
3
by: Adam Nielsen | last post by:
Hi everyone, I've run into yet another quirk with templates, which IMHO is a somewhat limiting feature of the language. It seems that if you inherit multiple classes, and those classes have...
3
by: Dan Noland | last post by:
I can work around this easily enough, but can someone help me understand why this works as it does? It seems that functions from a grandparent class are not available as candidates for overload...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.