Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <string.h>
- #define MAX_STRING 40
- /* struct created for the patients file */
- struct PatientsFile {
- char strFullName[MAX_STRING],
- dateOfBirth[MAX_STRING],
- weight[MAX_STRING],
- height[MAX_STRING],
- waistMes[MAX_STRING],
- comments[MAX_STRING]; };
- /* function declarations */
- void emptyBuffer(void);
- void inputLogin(void);
- int main (void)
- {
- inputLogin();
- return 0;
- }
- /* function that asks the nurse to enter a username and password */
- void inputLogin(void)
- {
- char strUsername, strPassword[8];
- printf("Please enter username:\n");
- scanf("%s", strUsername);
- emptyBuffer();
- printf("Please enter your password:\n");
- scanf("%s", strPassword);
- emptyBuffer();
- }
- /* clear buffer function */
- void emptyBuffer()
- {
- while(getchar() != '\n');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement