 |
|
|
|
SCHOOL SUBJECTS
-
-
-
-
-
-
-
-
-
-
-
-
|
|
|
GRADE LEVELS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
|
|
|
Post a New Question | Current Questions | Chat With Live Tutors
Homework Help Forum: Computers
Posted by Dave on Thursday, September 10, 2009 at 9:18am.
Operator overloading: Array indexing [] – allow for double indexing [][]
I'm not sure how to overload the operator[] for double indexing. Please help if you can. Thanks
|
- Computers - MathMate, Thursday, September 10, 2009 at 9:33am
You have not mentioned the language with which you are working. Since Java does not allow operator overloading, I assume you are working with C++. It would be nice to mention "Programming C++" or something similar in your subject.
Back to arrays. Native C++ already allows double array indexing. Something like the following already works as is, without additional code.
int a[4][4];
for(int i=0;i<4;i++)for(int j=0;j<4;j++)...
If you want to know more about operator overloading in general, you can read up textbooks, or tutorials such as:
http://www.deitel.com/articles/cplusplus_tutorials/20060204/
|
Answer this Question
|
|
|
 |