fork download
  1. #include <stdio.h>
  2.  
  3. // Define a structure for the address
  4. struct Address {
  5. char street[100];
  6. char city[50];
  7. char state[50];
  8. char zip[20];
  9. char planet[50];
  10. };
  11.  
  12. // Define a structure for the officer's information
  13. struct Officer {
  14. char name[50];
  15. char dateOfBirth[20];
  16. struct Address address;
  17. char rank[50];
  18. char lastPromotionDate[20];
  19. char ship[50];
  20. char nickname[20];
  21. char starfleetID[10];
  22. double hourlyPay;
  23. char favoriteSaying[100];
  24. double startingStardate;
  25. char maritalStatus[20];
  26. char starfleetGraduationDate[20];
  27. };
  28.  
  29. // Function prototype
  30. void initializeOfficers(struct Officer officers[], int size);
  31.  
  32. // Function definition
  33. /**
  34.  * Function Name: initializeOfficers
  35.  *
  36.  * Function Block:
  37.  * Initializes an array of Officer structures with sample data.
  38.  *
  39.  * @param officers[] The array of Officer structures to initialize.
  40.  * @param size The size of the officers array.
  41.  */
  42. void initializeOfficers(struct Officer officers[], int size) {
  43. // Example initialization (not required by the prompt)
  44. // Initialization code would go here
  45. }
  46.  
  47. // Declare an array of Officer structures
  48. struct Officer officers[2];
  49.  
  50. int main() {
  51. // Call the initializeOfficers function (if needed)
  52. initializeOfficers(officers, 2);
  53.  
  54. return 0;
  55. }
  56.  
Success #stdin #stdout 0s 5276KB
stdin
James Tiberius Krik
March 22, 2233
23 Falling Rock, Riverside, Iowa 52327-0021 Planet Earth 
Captain 
April 12, 2224 
USS Enterprise 
Jim 
02341232 
456.78 
"Bones???" 
41153.7 
Single 
June 23, 2212 
stdout
Standard output is empty