Can de-reference operator * be overloaded?

T

Tech Id

Is it possible to overload the operator * used to dereference
pointers?
Can you give a practical example of the same?
 
T

Tech Id

C does not support operator overloading, except in a limited number of
cases where the language itself directly specifies overloading. For
example, + is overloaded. Not only does it exist in two forms, unary and
binary (like *), but also it can be used to add (non-exhaustive list
coming up) int to int, int to char, char to double, double to float,
double to int, float to int, and even int to pointer.

It is widely believed that another language, based on and superficially
similar to C, does support operator overloading, but for authoritative
answers about that language it would be well for you to consult a
newsgroup specialising in it.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within

I asked this in context of C++
 
P

Paul N

I asked this in context of C++

There is a newsgroup, comp.lang.c++, which deals with the C++
language, so it's best to ask questions that deal with that language
there.

But you don't need to ask this one, because the answer is in the C++
FAQ at http://www.parashift.com/c++-faq-lite/ in the obvious chapter.
The rest of the FAQ is worth a read too. Happy programming!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top