This expr ??

M

MaXiMuS

Hi all,

-->> size *= (int)dims[j];

-->> retVal.m_vDims.push_back( dims[j] );

what do these two line of code mean? size is of type int.

thnks
 
K

Klaas Vantournhout

MaXiMuS said:
Hi all,

-->> size *= (int)dims[j];

-->> retVal.m_vDims.push_back( dims[j] );

what do these two line of code mean? size is of type int.

thnks

This depends on what retVal, n_vDims and dims are.
 
I

Ian Collins

MaXiMuS said:
Hi all,

-->> size *= (int)dims[j];

-->> retVal.m_vDims.push_back( dims[j] );

what do these two line of code mean? size is of type int.
You jest? Do you have a C++ book?
 
J

Jonathan Lane

Hi all,

-->> size *= (int)dims[j];

this calls operator *= on size. Same as writing
size.operator*=( (int)dims[j]);
-->> retVal.m_vDims.push_back( dims[j] );

This calls the push_back function on a member of class retVal called
m_vDims. It passes in the result of calling operator[] on dims with a
parameter of j.
 
J

Jim Langston

MaXiMuS said:
Hi all,

-->> size *= (int)dims[j];

*= is times equals.
a *= b;
is same as
a = a * b;
so this is
size = size * (int)dims[j];

If you can't figure it out from there, then you need to start back over from
page 1 of your book.
-->> retVal.m_vDims.push_back( dims[j] );

retVal is a structure or class.
It has some class/containter called m_vDims. maybe a vector.
it calls the functoin push_back of this instance. If it is a vector it is
pushing the value of dims[j] onto the vector at the end.

Start on page one of your book please.
 

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
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top