Fatihul Ulum Community of Knowledge
Would you like to react to this message? Create an account in a few clicks or log in to continue.

kelas didlam kelas

Go down

kelas didlam kelas Empty kelas didlam kelas

Post  cpp Mon Nov 23, 2009 10:57 pm

Code:

#include <iostream>
using namespace std;
class A
{
   public:
   void fungsi_A();
   class B;
   B *perantara;
};
class A :: B
{
   public :
   void fungsi_B ()
   {
      cout<<"Aku fungsi kelas B yang berada di kelas A"<<endl;
   }
};
void A :: fungsi_A ()
{
   cout <<"Aku fungsi dari kelas A"<<endl;
   perantara = new B;
   perantara->fungsi_B();
}
int main ()
{
   A a;
   a.fungsi_A();
}
//hehehehee


cpp
Pejuang
Pejuang

Jumlah posting : 35
Registration date : 15.03.09

Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik