The output from
printf("%d\n", num.a); in the above code is 3.
printf("%d\n", num); below it is also printed as 3.
Here's my question.
How on earth does
num have 3? For me,
num.I put the value in a.
I understand that
structure test serves as a data type, but
num plays a role other than connecting the values of the structure?
printf("%d\n", num.a); is an example of the normal usage of a structural member variable.
On the other hand,
printf("%d\n", num); is an undefined behavior.
Undefined behavior may have different results depending on the compiler version or compiler manufacturer.
© 2022 pinfo. All rights reserved.