Computers

posted by .

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 -

    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/

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. science C++ programing

    could you please help me with this program even with one part please: Adding two strings (Actually, the correct term is concatenate because unlike adding two number and getting a new result, we add a second string to the end of the …
  2. C++

    For each of the following problems, write a program or a program segment that performs the specified action.Each problem refers to class Polygon (Fig. L 11.15). This class contains a dynamically allocated array of x-coordinates and …
  3. Medical Information management and office practice

    What are the disadvantages of manual indexing?
  4. RECORD MANGEMENT

    I NEED HELP IN CODING AND INDEXING RECORDS.
  5. computer

    What is the syntax used for operator overloading?
  6. quantum physics

    The variance σX^2=⟨(X^−⟨X^⟩)^2⟩ of an operator, X^, is a measure of how large a range its possible values are spread over (the standard deviation is given by σ=sqrt(σ2)). Suppose that |X⟩ is …
  7. Math-trigonometry

    Please help me with the steps !i don't understand this. The working arm of a tower crane is 192m high and has a length of 71.6 m. Suppose the hook reaches the ground and moves along the arm of the trolley, a) determine max distance …
  8. Computer science(Information Retrieval Architectur

    A. Why are inverted files the most typical structure used for search systems?
  9. Diseases data classification & clinical coding

    Advantage and Disadvantage on manual indexing
  10. Diseases data classification & clinical coding

    What are the advantages and disadvantages of electronic indexing?

More Similar Questions