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

C / C++ / MFC

 
GeneralRe: a problem!!!! Pin
Christian Graus28-Jun-05 20:37
protectorChristian Graus28-Jun-05 20:37 
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 
I dont need extra class I'm going to check out of range x,y for m_data[x][y] in overloaded operator so I need that class will act as an array.
With simple array we can assign a value to it and read it:
int val;
val = m_data[x][y];
m_data[x][y] = val;

All this I want to be done by class

class Test
{
int m_data[10][10];

public:
int operator()(int x, int y);

};
int Test::operator()(int x, int y)
{
//check if x,y out of range
return m_data[y][x];
}

1. so we can read value by overloaded () operator
Test tst;
int val = tst(2,3); //which equ to val = m_data[x][y]

2. how to implement m_data[x][y] = val by Test class and what operator to overload?
if we overload just = operator then we will be able just
Test tst;
tst = 5; //but its not possible with this to provide x,y coeffs for m_data[x][y]


9ine
GeneralRe: Operator= overloading Pin
toxcct29-Jun-05 6:30
toxcct29-Jun-05 6:30 
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 

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.