fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. struct Complex{
  5. float real;
  6. float imag;
  7. }a, b, c;
  8.  
  9. struct Complex d = (struct Complex) {.real=3.14, .imag=-2.8};
  10.  
  11. printf("Value d: {.real = %.2f, .imag = %.2f }\n", d.real, d.imag);
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 4380KB
stdin
Standard input is empty
stdout
Value d: {.real = 3.14, .imag = -2.80 }