fork download
  1. #include <stdio.h>
  2.  
  3. // Date structure (reusable)
  4. struct date {
  5. int day;
  6. int month;
  7. int year;
  8. };
  9.  
  10. // Name components structure
  11. struct name {
  12. char title[10]; // Mr., Ms., Dr., etc.
  13. char first[50];
  14. char middle[50]; // Middle initial/name
  15. char last[50];
  16. char suffix[10]; // Jr., Sr., III, etc.
  17. };
  18.  
  19. // Address components structure
  20. struct address {
  21. char street[50];
  22. char city[50];
  23. char state[50];
  24. char zip[15]; // ZIP+4 format
  25. char planet[50];
  26. };
  27.  
  28. // Main officer record structure
  29. struct officer {
  30. struct name fullName;
  31. struct date dateOfBirth;
  32. struct address homeAddress;
  33.  
  34. char rank[50];
  35. struct date lastPromotion;
  36.  
  37. char ship[50];
  38. char nickname[50];
  39. char starFleetID[9]; // 8-character ID + null terminator
  40.  
  41. float hourlyPay;
  42. char favoriteSaying[256];
  43. double startingStardate;
  44.  
  45. char maritalStatus[20];
  46. struct date starfleetGraduation;
  47. };
  48.  
  49. // Array declaration for storage
  50. struct officer starfleetPersonnel[100];
  51.  
  52. // Minimal main function for Ideone compatibility
  53. int main(void) {
  54. // This empty main allows compilation but does nothing
  55. return 0;
  56. }
Success #stdin #stdout 0s 5276KB
stdin
John|Doe|Captain|
stdout
Standard output is empty