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

i can't understand this statement: &origin + ( &Point3d::_y - 1 );

when i read the notable book of inside the c++ bject model ,i was
confused by the chapter 3.3. i was confused by the statement as follow:
chaper 3.3:

Given the following pair of program statements:

Point3d origin; .....Access of a nonstatic data member requires the addition
of the beginningaddress of the class object with the offset location of the
data member.For example, givenorigin._y = 0.0; the address of&origin._y; is
equivalent to the addition of&origin + ( &Point3d::_y - 1 ); i don't
understand why the address of object of origin is compute by the
this : &origin + (&Point3d::_y -1 ) ;
especially for &Point3d::_y ,it is what ?
thanks for any clue?

regards
coco
Jul 22 '05 #1
1 1425
charles wrote:
when i read the notable book of inside the c++ bject model ,i was
confused by the chapter 3.3. i was confused by the statement as follow:
chaper 3.3:

Given the following pair of program statements:

Point3d origin; .....Access of a nonstatic data member requires the addition
of the beginningaddress of the class object with the offset location of the
data member.For example, givenorigin._y = 0.0; the address of&origin._y; is
equivalent to the addition of&origin + ( &Point3d::_y - 1 ); i don't
understand why the address of object of origin is compute by the
this : &origin + (&Point3d::_y -1 ) ;
especially for &Point3d::_y ,it is what ?


( &Point3d::_y - 1 ) is the offset location of the data member, like
Stan says. The significance of the " - 1" is explained elsewhere.

This isn't C++ syntax, it's "pseudocode" for humans. Everything in
pseudocode is also explained in the text. You'll get used to it.

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

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

Similar topics

4
by: Rich | last post by:
Hi all I am using DEVCPP 4.9.8.1 which uses MingW32 GCC 3.2 compiler I am trying to compile this program, but without success, I am sure the compiler is set up ok, as I can compile and run...
0
by: Tony Williams | last post by:
I have posted a number of posts in the Access newsgroups concerning my problem with DLookup. I have had a number of the experts with helpful suggestions but I still can't get it to work! This is...
0
by: CMEDIA_SOUND | last post by:
I have a peculiar problem, I have a tabpage with a label control on it. When i set a background image to the tabpage and drag the label around it has paint issues in that it is slow, granted the...
6
by: ancelotp | last post by:
hi, i'm new to sql i'd appretiate if someone would helpme out with this doudt i have CODE: CREATE TABLE entry ( uno int(6) NOT NULL auto_increment, fname varchar(30) NOT NULL, sname...
3
by: Daniel | last post by:
LoaderLock was detected Message: DLL 'C:\WINDOWS\assembly\GAC\Microsoft.DirectX.Direct3D\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.Direct3D.dll' is attempting managed execution inside OS...
12
by: lalou89 | last post by:
Develop a simple text editor program. The program will show the user a menu of choices and will act according to his choice. Use functional decomposition to break the system into small functions that...
3
bhing
by: bhing | last post by:
Hiya all!!! i would like to ask about the http logs i found in logs directory in tomcat. This is some of the codes i clipped: ----------------------------------------------------------- ...
5
gpraghuram
by: gpraghuram | last post by:
HI all, I wrote the following piece of code class A { A(){cout<<"ctor"<<endl; ~A(){cout<<"dtor"<<endl; }; int main()
4
by: hathan | last post by:
Hi, i am trying to add a new row into a microsoft access database and cant understand why it wont work. Can anyone please help me understand what this means? The error message says: **************...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.