Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct user {
- string username;
- string password;
- };
- user *init_user(const string & username, const string & password){
- user *u = (user *)malloc(sizeof(user));
- if (u == NULL){
- return NULL;
- }
- u->username = username;
- u->password = password;
- return u;
- }
- u->username = username;
- u->password = password;
- user *init_user(const string & username, const string & password) {
- user* u = new user;
- u->username = username;
- u->password = password;
- return u;
- }
Add Comment
Please, Sign In to add comment