T
Tech Id
Is it possible to overload the operator * used to dereference
pointers?
Can you give a practical example of the same?
pointers?
Can you give a practical example of the same?
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++
I asked this in context of C++
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.