Click here to Skip to main content
15,914,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOperator= overloading Pin
Member 341989128-Jun-05 20:01
Member 341989128-Jun-05 20:01 
GeneralRe: Operator= overloading Pin
Christian Graus28-Jun-05 20:06
protectorChristian Graus28-Jun-05 20:06 
GeneralRe: Operator= overloading [edited - bis] Pin
toxcct28-Jun-05 20:23
toxcct28-Jun-05 20:23 
GeneralRe: Operator= overloading Pin
Cedric Moonen28-Jun-05 20:31
Cedric Moonen28-Jun-05 20:31 
GeneralRe: Operator= overloading Pin
toxcct28-Jun-05 20:33
toxcct28-Jun-05 20:33 
GeneralRe: Operator= overloading Pin
Cedric Moonen28-Jun-05 20:37
Cedric Moonen28-Jun-05 20:37 
GeneralRe: Operator= overloading Pin
Member 341989129-Jun-05 3:52
Member 341989129-Jun-05 3:52 
GeneralRe: Operator= overloading Pin
toxcct29-Jun-05 6:30
toxcct29-Jun-05 6:30 
9ine wrote:
int Test::operator()(int x, int y)
{
//check if x,y out of range
return m_data[y][x];
}


it won't work until it returns an int (copy of the actual value... so, it is not an lvalue, an the compiler won't accept you to assign the result of the operator()().

use int& instead, as i did in my first answer[^]...



TOXCCT >>> GEII power
[toxcct][VisualCalc]
GeneralRe: Operator= overloading Pin
Member 341989129-Jun-05 19:33
Member 341989129-Jun-05 19:33 
GeneralRe: Operator= overloading Pin
toxcct29-Jun-05 20:11
toxcct29-Jun-05 20:11 
GeneralRe: Operator= overloading Pin
Member 341989129-Jun-05 23:12
Member 341989129-Jun-05 23:12 
GeneralRe: Operator= overloading Pin
toxcct30-Jun-05 0:11
toxcct30-Jun-05 0:11 
GeneralMFC controls. CListBox Pin
mpuerto28-Jun-05 18:28
mpuerto28-Jun-05 18:28 
GeneralRe: MFC controls. CListBox Pin
Christian Graus28-Jun-05 18:30
protectorChristian Graus28-Jun-05 18:30 
GeneralRe: MFC controls. CListBox Pin
mpuerto28-Jun-05 18:51
mpuerto28-Jun-05 18:51 
GeneralRe: MFC controls. CListBox Pin
Christian Graus28-Jun-05 19:03
protectorChristian Graus28-Jun-05 19:03 
GeneralRe: MFC controls. CListBox Pin
mpuerto28-Jun-05 19:19
mpuerto28-Jun-05 19:19 
GeneralRe: MFC controls. CListBox Pin
Christian Graus28-Jun-05 19:31
protectorChristian Graus28-Jun-05 19:31 
GeneralRe: MFC controls. CListBox Pin
Jose Lamas Rios29-Jun-05 2:54
Jose Lamas Rios29-Jun-05 2:54 
GeneralRe: MFC controls. CListBox Pin
mpuerto29-Jun-05 3:11
mpuerto29-Jun-05 3:11 
GeneralRe: MFC controls. CListBox Pin
PJ Arends28-Jun-05 20:46
professionalPJ Arends28-Jun-05 20:46 
Generaluser switching Pin
Member 171940628-Jun-05 18:22
Member 171940628-Jun-05 18:22 
GeneralQuestion Regarding Template in C++ Pin
phijophlip28-Jun-05 18:05
phijophlip28-Jun-05 18:05 
GeneralRe: Question Regarding Template in C++ Pin
Christian Graus28-Jun-05 18:31
protectorChristian Graus28-Jun-05 18:31 
GeneralRe: Question Regarding Template in C++ Pin
Christian Graus28-Jun-05 19:06
protectorChristian Graus28-Jun-05 19:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.