Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. void printNameWithArray(contact* contactArray, int size)
  2. {
  3. int i = 0;
  4.  
  5. for(; i < size; i++)
  6. {
  7.  
  8. printf("\nID: %d\n", contactArray[i].ID);
  9. printf("Name: %s\n", contactArray[i].name);
  10. printf("Surname: %s\n", contactArray[i].surname);
  11. printf("City: %s\n", contactArray[i].address->city);
  12. printf("Street: %s\n", contactArray[i].address->street);
  13. printf("House number: %d\n", contactArray[i].address->houseNumber);
  14. printf("Zip code: %s\n", contactArray[i].address->zipCode);
  15. printf("Post office: %s\n", contactArray[i].address->postOffice);
  16. int itterator =1;
  17. int mailIterator = 1;
  18. phone_t *temp = contactArray[i].phoneHead;
  19. email_t *temp2 = contactArray[i].emailHead;
  20. printf("Phone numbers:\n");
  21. while(temp != NULL)
  22. {
  23.  
  24. printf("%d) %d\n", itterator, temp->phoneNumber);
  25. itterator++;
  26. temp = temp->next;
  27. }
  28. printf("Emails:\n");
  29. while(temp2 != NULL)
  30. {
  31.  
  32. printf("%d) %s\n", mailIterator, temp2->emailAddress);
  33. mailIterator++;
  34. temp2=temp2->next;
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement