fork download
  1. #include <iostream>
  2.  
  3. int main(int argc, char const *argv[])
  4. {
  5.  
  6. auto f1 = new float[2][10];
  7. std::cout << "F1[0]: " << f1[0] << std::endl;
  8. std::cout << "F1[1]: " << f1[1] << std::endl;
  9. std::cout << "F1[1] - F1[0] : " << f1[1] - f1[0] << std::endl;
  10.  
  11. auto f2 = new float[2][5];
  12. std::cout << "F2[0]: " << f2[0] << std::endl;
  13. std::cout << "F2[1]: " << f2[1] << std::endl;
  14. std::cout << "F2[1] - F2[0] : " << f2[1] - f2[0] << std::endl;
  15.  
  16. auto f3 = new float[5][5];
  17. std::cout << "F3[0]: " << f3[0] << std::endl;
  18. std::cout << "F3[1]: " << f3[1] << std::endl;
  19. std::cout << "F3[1] - F3[0] : " << f3[1] - f3[0] << std::endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
F1[0]: 0x85c4008
F1[1]: 0x85c4030
F1[1] - F1[0] : 10
F2[0]: 0x85c4060
F2[1]: 0x85c4074
F2[1] - F2[0] : 5
F3[0]: 0x85c4090
F3[1]: 0x85c40a4
F3[1] - F3[0] : 5