fork download
  1. #include <iostream>
  2. #include <string.h>
  3.  
  4. constexpr char my_str[] = "hehe12";
  5. constexpr int u = sizeof(my_str);
  6. constexpr int v = strlen(my_str);
  7. using array_type = int[v];
  8.  
  9. int main()
  10. {
  11. std::cout << u << '\n';
  12. std::cout << v << '\n';
  13.  
  14. array_type array = {10, 20, 30};
  15. std::cout << array[0] << '\n';
  16. std::cout << array[1] << '\n';
  17. std::cout << array[2] << '\n';
  18. std::cout << array[3] << '\n';
  19. return 0;
  20. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
7
6
10
20
30
0