fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct S
  6. {
  7. short i;
  8. };
  9.  
  10.  
  11. int main()
  12. {
  13. auto s = new S[2];
  14. cout << (ptrdiff_t)&s[1] - (ptrdiff_t)&s[0] << "\n";
  15. };
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
2