Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* masfiq 8th december, 2016*/
- #include<iostream>
- #include<cstring>
- #include<cstdlib>
- using namespace std;
- class Demo{
- int a[];
- public :
- int& operator [] (int idx){
- return a[idx];
- }
- };
- int main(){
- Demo demo;
- demo[2] = 10;
- cout<<demo[2];
- }
- output :
- 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement