stoneharry

Untitled

Nov 11th, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void HandleNameInput(int n)
  2. {
  3.     char FirstName[50];
  4.     char LastName[50];
  5.     int i = 0;
  6.     int done = 0;
  7.  
  8.     printf("Please input your first and last names seperated by a space.\n\n");
  9.  
  10.     scanf("%s%s", &FirstName, &LastName);
  11.  
  12.     for (i = 0; i < 100; i++)
  13.     {
  14.         if (FirstName[i] != NULL)
  15.         {
  16.             GuestNames[i][n] = FirstName[i];
  17.         }
  18.         else if (done == 0)
  19.         {
  20.             GuestNames[i][n] = ' ';
  21.             done = i;
  22.         }
  23.         else
  24.         {
  25.             GuestNames[i][n] = LastName[i-done];
  26.         }
  27.     }
  28.  
  29.     printf("\nYour name has been successfully saved. Thank you.\n\n");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment