Advertisement
Josif_tepe

Untitled

Mar 29th, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. class Student {
  6. private:
  7.     char ime[50];
  8.     char prezime[50];
  9. public:
  10.     Student() {}
  11.     Student(char *i, char *p) {
  12.         strcpy(ime, i);
  13.         strcpy(prezime, p);
  14.     }
  15.     Student(const Student &tmp) { // copy constructor
  16.         strcpy(ime, tmp.ime);
  17.         strcpy(prezime, tmp.prezime);
  18.     }
  19. };
  20. int main() {
  21.     Student s("a", "a");
  22.     Student s2 = s;
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement