Guest User

Untitled

a guest
Apr 4th, 2023
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | Source Code | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. struct A {
  6.     int i = {};
  7.     A(int _i) : i(_i) {}
  8.     operator int() {
  9.         return int(*this);
  10.     }
  11. };
  12.  
  13. int main() {
  14.  
  15.     A a(10);
  16.     cout << int(a) << endl;
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment