I am trying to create a class that use the operator [] like 

```
MyClass[x][y]

```

and it should return a value based on what I call in the function that is defined within the class. What I have so far is:

MyClass.h

```
class MyClass{
   public:
          // return one value of the matrix
     friend double operator[][] (const int x, const int y); 
   }

```

I don't even think my syntax for this is right, and how can I write this function in MyClass.cpp to define what value it should return?

Like is it:

```
MyClass::friend double operator[][] (const int x, const int y)
{
  // insert code here
}

```

Tried it but it keeps saying errors. I believe it is a mess up there...

Many thanks,