fork download
  1. #include <iostream>
  2. #include <cstddef>
  3. template<std::size_t Size>
  4. void f(int (&Array)[Size])
  5. {
  6. // Ein anderer Scope
  7. std::cout << sizeof(Array) / sizeof(*Array) << '\n';
  8. std::cout << Size << '\n';
  9. }
  10. int main()
  11. {
  12. int Foo[5];
  13.  
  14. f(Foo);
  15.  
  16. {
  17. // Auch ein anderer Scope
  18. std::cout << sizeof(Foo) / sizeof(*Foo) << '\n';
  19. }
  20. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
5
5
5