Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- private:
- char ime[50];
- char prezime[52];
- public:
- Student(const char* i = "", const char *p = "") {
- strcpy(ime, i);
- strcpy(prezime, p);
- }
- ~Student() {
- }
- friend class Student_na_smer_KTI;
- friend void pecati(Student s);
- };
- class Student_na_smer_KTI {
- private:
- Student s;
- double prosek;
- public:
- Student_na_smer_KTI(Student _s, double p) {
- s = _s;
- prosek = p;
- }
- const char* get_ime() const {
- return s.ime;
- }
- };
- void pecati(Student s) {
- cout << s.ime << " " << s.prezime << endl;
- }
- int main() {
- Student s("finki", "finki");
- Student_na_smer_KTI t(s, 10.0);
- pecati(s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement