Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

access past the end 2

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.75 sec, absolute service time: 0,94 sec 
edit mode |  history
Error(s):
199667517/source.cpp:9:19: error: constexpr variable 'val' must be initialized by a constant expression
    constexpr int val = arr[0][2];
                  ^     ~~~~~~~~~
199667517/source.cpp:9:25: note: read of dereferenced one-past-the-end pointer is not allowed in a constant expression
    constexpr int val = arr[0][2];
                        ^
199667517/source.cpp:9:25: warning: array index 2 is past the end of the array (which contains 2 elements) [-Warray-bounds]
    constexpr int val = arr[0][2];
                        ^      ~
199667517/source.cpp:8:5: note: array 'arr' declared here
    constexpr static int arr[2][2] = {{0, 1}, {2, 3}};
    ^
1 warning and 1 error generated.

        

    
                
λ
.NET NoSQL database for rapid development