-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.cpp
More file actions
43 lines (36 loc) · 782 Bytes
/
User.cpp
File metadata and controls
43 lines (36 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Created by dee l on 14/03/2026.
//
#include <iostream>
#include "User.h"
#include "utils.h"
#include <cstring>
User::User(char pre[], char nm[], char se[], int num, char pass[]) {
srand(time(NULL));
int n = (rand()%5000)+1;
if (abdallah::identifiantUserExist(n)) {
id = n;
}
nom = new char[strlen(nm +1)];
strcpy(nom,nm);
prenom = new char[strlen(pre +1)];
strcpy(prenom,pre);
strcpy(type,"user");
sexe = new char[strlen(se)+1];
strcpy(sexe,se);
numTel = num;
passwd = new char[strlen(pass)+1];
strcpy(passwd,pass);
}
User::~User() {
delete[] nom;
delete[] prenom;
delete[] sexe;
delete[] passwd;
}
//emprunter un livre
void User::emprunterLivre() {
}
int User::getid() {
return id;
}