Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- private:
- string ime;
- int br_na_index;
- float prosek;
- public:
- Student() {
- cout << "empty/default constructor" << endl;
- }
- Student(string _ime, int _br_na_index, float _prosek) {
- ime = _ime;
- br_na_index = _br_na_index;
- prosek = _prosek;
- cout << "parameters" << endl;
- }
- Student(const Student & tmp) {
- ime = tmp.ime;
- br_na_index = tmp.br_na_index;
- prosek = tmp.prosek;
- cout << "copy constructor" << endl;
- }
- ~Student() {
- cout << "destructor" << " " << ime << endl;
- }
- };
- int main()
- {
- Student s1("josif", 200, 4.5);
- Student s2("Ana", 100, 5.6);
- Student s3("Viktorija", 900, 8.2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement