Advertisement
Guest User

Untitled

a guest
Dec 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #define MAX_STRING 40
  4.  
  5. /* struct created for the patients file */
  6. struct PatientsFile {
  7.     char strFullName[MAX_STRING],
  8.     dateOfBirth[MAX_STRING],
  9.     weight[MAX_STRING],
  10.     height[MAX_STRING],
  11.     waistMes[MAX_STRING],
  12.     comments[MAX_STRING]; };
  13.  
  14. /* function declarations */
  15. void emptyBuffer(void);
  16. void inputLogin(void);
  17.  
  18. int main (void)
  19. {
  20.     inputLogin();
  21.  
  22.     return 0;
  23. }
  24.  
  25. /* function that asks the nurse to enter a username and password */
  26. void inputLogin(void)
  27. {
  28.     char strUsername, strPassword[8];
  29.     printf("Please enter username:\n");
  30.     scanf("%s", strUsername);
  31.     emptyBuffer();
  32.     printf("Please enter your password:\n");
  33.     scanf("%s", strPassword);
  34.     emptyBuffer();
  35.  
  36. }
  37.  
  38. /* clear buffer function */
  39. void emptyBuffer()
  40. {
  41.     while(getchar() != '\n');
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement