Advertisement
Guest User

Untitled

a guest
May 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. int main(void){
  2.  
  3. int quit=1;
  4. char s;
  5. char username[20];
  6. char password[20];
  7. char type[20];
  8. char user_2[20];
  9. char pass_2[20];
  10. char type_2[20];
  11.  
  12. FILE * file;
  13.  
  14. while(quit!=-1){
  15. printf("Please choose from the following options: \n");
  16. printf("(a)dd\n");
  17. printf("(d)el\n");
  18. printf("(e)dit\n");
  19. printf("(v)erify\n");
  20. printf("(q)ut\n");
  21. scanf("%c",&s);
  22.  
  23. switch(s){
  24.  
  25. case 'a':
  26. file=fopen("password.csv","rw");
  27. printf("%s","username: ");
  28. scanf("%s", username);
  29. printf("password: ");
  30. scanf("%s",password);
  31. printf("type: ");
  32. scanf("%s",type);
  33. fprintf(file, "%s %s %s", username, password, type);
  34. fclose(file);
  35.  
  36. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement