By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,823 Members | 730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,823 IT Pros & Developers. It's quick & easy.

Can anybody explain this snippet for me?

P: n/a
HI,

I ran across a code written by somebody else. Since I am new to C++,
could you please explain what each of "const *" means in this code
snippet as well as the last "const"?

Tool const* const* tool_array() const;

Tool is an internal structure defined somewhere else. tool_array()
gets an entire array of Tool type.
Thank you.

Oct 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
we*********@gmail.com wrote:
I ran across a code written by somebody else. Since I am new to C++,
could you please explain what each of "const *" means in this code
snippet as well as the last "const"?

Tool const* const* tool_array() const;

Tool is an internal structure defined somewhere else. tool_array()
gets an entire array of Tool type.
The function 'tool_array' is a non-static member function of some
class. It returns a pointer to a constant pointer to a constant
object of type Tool (those are the two 'const' between 'Tool' and
the name of the function), and does not change the object for which
it is called (that's the 'const' after the [empty] argument list):
it can be called for a constant object.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.