Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class Osoba {
- char * _imePrezime;
- public:
- Osoba(const char * imePrezime) {
- _imePrezime = new char[strlen(imePrezime) + 1];
- strcpy_s(_imePrezime, strlen(imePrezime) + 1, imePrezime);
- }
- virtual ~Osoba() = 0 {
- delete[]_imePrezime;
- _imePrezime = nullptr;
- }
- };
- class Student:public Osoba {
- int _index;
- public:
- Student(const char * imePrezime, int index):Osoba(imePrezime) {
- _index = index;
- }
- };
- void main() {
- /*Osoba Almedin("Almedin");*/
- Osoba * osoba = new Student("Alemdin", 19292929);
- Student Faris("Faris", 150150);
- system("pause>0");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement