C++ does not allow copying of C-style arrays using =. But allows copying of structures using =, as in this link -> Copying array in C v/s copying structure in C.It does not have any credible answers yet.
But consider following code
#include <iostream>
using namespace std;
struct user {
int a[4];
char c;
};
int main() {
user a{{1,2,3,4}, 'a'}, b{{4,5,6,7}, 'b'};
a = b; //should have given any error or warning but nothing
return 0;
}
Above code segment didn't gave any kind of errors and warnings, and just works fine. WHY? Consider explaining both questions(this one and the one linked above).