What does this kind of declaration mean in c++?
CSomething & SOMETHING = m_vSOMETHING[m_iSOMETHING];
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is a reference variable which is initialized to point to the specified cell in
m_vSOMETHINGSo a declaration of
Will produce reftotable as a variable which reference cell 42 in the table, similar to what
would do. In the first case with the reference you can assign reftotable like it was a normal variable
where in the other case you will have to do
to do the same thing — that is, in both cases table[42] will contain the value 37 after the assignment.