On 13.01.2017 02:54, Paul wrote:
> In the below code, I'm unclear as to what Data result = {} does. Is this
> the same as Data result = Data();
Yes, in the sense of having the same effect in this case.
> After the line Data result = {}; are the values of bytes all equal to 0,
Yes.
> or are they garbage values?
No.
> I'm thinking garbage values but I'm not sure.
> Many thanks for your help.
> Paul
>
>
> struct Data {
> char bytes[16];
> };
>
> Data f() {
> Data result = {};
> // generate result
> return result;
> }
>
> int main() {
> Data d = f();
> }
>
Cheers,
- Alf