fork download
  1. #include <iostream>
  2. using namespace std;
  3. #define OOO(a_, b_) \
  4. do { cout << &(a_) << " " << &(b_) <<" "<< (long)&(b_) -(long)&(a_) << std::endl; } while(0)
  5.  
  6. void shit(long a, short b, long c, short d, long e, short f, long g){
  7. OOO(a,b); OOO(b,c); OOO(c,d); OOO(d,e); OOO(e,f); OOO(f,g);
  8. }
  9.  
  10. void shit2(long a, long b, long c, long d, long e, long f, long g){
  11. OOO(a,b); OOO(b,c); OOO(c,d); OOO(d,e); OOO(e,f); OOO(f,g);
  12. }
  13.  
  14. int main() {
  15. #if defined(__linux)
  16. cout << "Linux detected" << endl;
  17. #endif
  18. cout << ((sizeof(long) == 8)+1)*32 << "bit arch" << endl;
  19. shit(0,0,0,0,0,0,0);
  20. cout << endl;
  21. shit2(0,0,0,0,0,0,0);
  22. return 0;
  23. }
Success #stdin #stdout 0s 3300KB
stdin
Standard input is empty
stdout
Linux detected
32bit arch
0xbfe826b0 0xbfe8269c -20
0xbfe8269c 0xbfe826b8 28
0xbfe826b8 0xbfe82698 -32
0xbfe82698 0xbfe826c0 40
0xbfe826c0 0xbfe82694 -44
0xbfe82694 0xbfe826c8 52

0xbfe826b0 0xbfe826b4 4
0xbfe826b4 0xbfe826b8 4
0xbfe826b8 0xbfe826bc 4
0xbfe826bc 0xbfe826c0 4
0xbfe826c0 0xbfe826c4 4
0xbfe826c4 0xbfe826c8 4