B
batista
Hello to All,
Let me explain my problem with a pseudo code:
class A
{
int x;
char y;
string z;
}
class B
{
GetVariable(int i)
{
A a = new A();
//Now i want to return ith variable of a in
//this function
}
}
class C
{
getvar()
{
B b = new B();
b.GetVariable(0) //it shud return x
b.GetVariable(1) //it shud return y
b.GetVariable(2) //it shud return z
}
}
Now how do i implement GetVariable(int i) function?
The reason i have put class B in between is because
There are many classes like A and i don't want to change
them.
Any Suggestion...
Thanks In Advance...
Cheers...
Bye
Let me explain my problem with a pseudo code:
class A
{
int x;
char y;
string z;
}
class B
{
GetVariable(int i)
{
A a = new A();
//Now i want to return ith variable of a in
//this function
}
}
class C
{
getvar()
{
B b = new B();
b.GetVariable(0) //it shud return x
b.GetVariable(1) //it shud return y
b.GetVariable(2) //it shud return z
}
}
Now how do i implement GetVariable(int i) function?
The reason i have put class B in between is because
There are many classes like A and i don't want to change
them.
Any Suggestion...
Thanks In Advance...
Cheers...
Bye