I thought I have to do a memcpy every time, but it apparently is working in my program? How is it possible without a copy constructor to deal with the char array?
If both are correct, could you explain what is the difference between 1 and 2? I am confused on pass a reference of array to another array.
arrays are perfectly copyable and assignable when they are wrapped in structs. That was one of the major innovations of C over B.
In C++, you can also use std::array<type, 8> to get an array wrapped in a struct with a container-compatible interface. (where type is the type of the elements of quadw that you didn't write)
There is no visible difference between 1 and 2, in both cases temp is copy-initialized from myObject.myValue
PS: the C++ standardese for this is § 12.8[class.copy]/15
Each base or non-static data member is copied/moved in the manner appropriate to its type:
— if the member is an array, each element is direct-initialized with the corresponding subobject of x;