Guest User

Untitled

a guest
Jun 7th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. struct user {
  2. string username;
  3. string password;
  4. };
  5.  
  6. user *init_user(const string & username, const string & password){
  7. user *u = (user *)malloc(sizeof(user));
  8. if (u == NULL){
  9. return NULL;
  10. }
  11. u->username = username;
  12. u->password = password;
  13. return u;
  14. }
  15.  
  16. u->username = username;
  17. u->password = password;
  18.  
  19. user *init_user(const string & username, const string & password) {
  20. user* u = new user;
  21. u->username = username;
  22. u->password = password;
  23. return u;
  24. }
Add Comment
Please, Sign In to add comment