Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. //user-proc.h
  2. #ifndef USER_PROC_H
  3. #define USER_PROC_H
  4.  
  5. #include <iostream>
  6. #include <string>
  7. using namespace std;
  8.  
  9. typedef struct UserKnowledge{
  10. unsigned int id;
  11. string name,surname,username,password,email;
  12. }levy;
  13.  
  14. void test();
  15.  
  16. class cregister{
  17. private:
  18. levy user;
  19. int testp;
  20. public:
  21. friend void test();
  22. cregister(levy &tmp);
  23. levy getUser();
  24. void displayUser(levy &);
  25. };
  26.  
  27. #endif // USER_PROC_H
  28.  
  29. // user-proc.cpp
  30.  
  31. #include <iostream>
  32. #include <string>
  33. #include "../include/user-proc.h"
  34.  
  35. using namespace std;
  36.  
  37. cregister::cregister(levy &tmp)
  38. {
  39. this->user = tmp;
  40. }
  41. levy cregister::getUser()
  42. {
  43. return this->user;
  44. }
  45. void cregister::displayUser(levy &user)
  46. {
  47. cout << "[INFO] ID : " << user.id << endl;
  48. cout << "[INFO] Name : " << user.name << endl;
  49. cout << "[INFO] Surname : " << user.surname << endl;
  50. cout << "[INFO] Username : " << user.username << endl;
  51. cout << "[INFO] Password : " << user.password << endl;
  52. cout << "[INFO] E-Mail : " << user.email << endl;
  53. }
  54. void test()
  55. {
  56. cout << "test" << endl;
  57. testp = 50;
  58. }
  59.  
  60. // main.cpp
  61.  
  62. #include <iostream>
  63. #include <string>
  64. #include "../include/user-proc.h"
  65.  
  66. using namespace std;
  67.  
  68. int main(){
  69.  
  70. test();
  71.  
  72. return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement