Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student{
- public:
- char ime[50];
- char prezime[50];
- Student() {
- cout << "empty" << endl;
- }
- Student(const char *i, const char *p) {
- strcpy(ime, i);
- strcpy(prezime, p);
- cout << "default" << endl;
- }
- Student(const Student &tmp) {
- strcpy(ime, tmp.ime);
- strcpy(prezime, tmp.prezime);
- cout << "copy" << endl;
- }
- ~Student() {
- cout << "dec" << endl;
- }
- };
- int main() {
- Student S;
- S = Student("stanko", "stanko");
- Student X = S;
- cout << X.ime << " " << X.prezime << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement