fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. //myStruct is a type that has 2 firelds
  7. struct myStruct {
  8. int Anint;
  9. float AFloat;
  10. };
  11.  
  12. // make an instance of mtStruct called M
  13. struct myStruct M;
  14. // fill its fields and print them
  15. M.Anint = 1;
  16. M.AFloat = 1.2f;
  17. printf ("M has values:\n InInt=%d\n AFloat=%f\n",
  18. M.Anint, M.AFloat);
  19.  
  20. return 0;
  21. }
  22.  
  23.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
M has values:
 InInt=1
 AFloat=1.200000