I not read your solution deeply but u got compilation error since char
after opening bracket of in main you uses ';'

On Wed, Nov 13, 2019, 19:48 Bat Orshih <[email protected]> wrote:

> # include<iostream>
> # include<conio.h>
> # include<string.h>
> using namespace std;
> class Teacher;
> class Student{
> friend class Teacher;
> int age;
> public:
> Student() { age=20;};
> void print()
> { cout<<"Student's age:"<<age<<endl; }
> };
> class Teacher{
> char name[25];
> public:
> Teacher(char *name1) {strcpy(name,name1);};
> void print()
> { cout<<"Teacher's name:"<<name<<endl; }
> void T_ddd(Student &student){student.age=23;};
> };
> int main()
> {;
> Student st; st.print();
> Teacher tch("D.Undrah");
> tch.print();
> getch();
> tch.T_ddd(st);
> st.print();
> getch();
> };
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7e671366-a25a-449a-8a33-156415c60005%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/7e671366-a25a-449a-8a33-156415c60005%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CANjbcg8uO-1vmk1ZttU7ARy00iHp9rYDE0aRpA3qGsfcQUamYA%40mail.gmail.com.

Reply via email to