Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void HandleNameInput(int n)
- {
- char FirstName[50];
- char LastName[50];
- int i = 0;
- int done = 0;
- printf("Please input your first and last names seperated by a space.\n\n");
- scanf("%s%s", &FirstName, &LastName);
- for (i = 0; i < 100; i++)
- {
- if (FirstName[i] != NULL && done == 0)
- {
- GuestNames[i][n] = FirstName[i];
- }
- else if (done == 0)
- {
- GuestNames[i][n] = ' ';
- done = i;
- }
- else
- {
- if (LastName[i] != NULL)
- {
- GuestNames[i][n] = LastName[(i-1)-done];
- }
- }
- }
- printf("\nYour name has been successfully saved. Thank you.\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment