I'm creating my own class String in C++. I stacked at this point:
class String{
char* arr;
int len;
String& operator[](int);
}
String& String::operator[](int n) {
len = 1;
arr = new char[1];
arr = *arr[n];
}
The compiler shows me this:
In member function ‘String& String::operator’: error: invalid type argument of ‘unary *’</p>
Where is the bug? Thanks for help! :)