473,395 Members | 1,442 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,395 software developers and data experts.

Can anybody explain this snippet for me?

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
1 1389
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Kalle Rutanen | last post by:
Hello Here is a short code snippet which does not compile. Could someone explain why this is ? class A { public: void set(int a) {
9
by: andrew | last post by:
Hi, I posted this message recently, but received no response, so I figured I'd try again. I can't find anybody who can tell me what's going on here. I'm having a problem with fieldsets in IE...
3
by: Clamps | last post by:
I was wondering if anybody gets similar results when attempting to query an XML Doc with an XPath query or if this is expected behavior or if I'm using something incorrectly. <xml ...>...
4
by: Tweaxor | last post by:
Hey, forgive me of my ignorance! Can someone tell me why this won't work. I have this coded but it won't compile is this not permitted in C. kg = kilograms and d = distance // this is not...
1
by: qushui_chen | last post by:
Anybody can explain the directly send mail to pop3 Server? 1.if it is use Smtp protocol? 2.if i write one Smtp Server?
6
by: amerar | last post by:
Hi All, I'm not good at Javascript, so I am trying to understand this small bit of code: var groups=document.$fm.category.options.length; var group=new Array(groups); for (i=0; i<groups;...
24
by: muttaa | last post by:
i've a code snippet below: for(;0;) printf("Gud Morning"); when this is run,i get the "gud morning" message printed,eventhough the
2
by: maifs | last post by:
hi..... can anybody tell me that how can i save my all application's work. mean that how can i save the images,circles,rectangle,lines or etl together.. if somebody knows it then plz explain me...
4
by: tshad | last post by:
I was watching a video that used a code snippet to create a property and when you type "prop" tab tab, it would create the private variable as well as the property definitions with the private...
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: 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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.