You're not comparing the contents of the arrays, you're comparing the addresses of the arrays. Since they're two separate arrays, they have different addresses.
Avoid this problem by using higher-level containers, such as std::vector
, std::deque
, or std::array
.