How to change the meaning of pointer access operator
- by kumar_m_kiran
Hi All,
This may be very obvious question, pardon me if so.
I have below code snippet out of my project,
#include <stdio.h>
class X
{
public:
int i;
X() : i(0) {};
};
int main(int argc,char *arv[])
{
X *ptr = new X[10];
unsigned index = 5;
cout<<ptr[index].i<<endl;
return 0;
}
Question
Can I change the…