Quote Originally Posted by 2kaud View Post
Consider this very simple example
Code:
#include <iostream>
#include <string>
using namespace std;

template<typename T>
class A {
private:
	T pa;

public:
	A(T a) : pa(a) {}
	T geta() const {
		return pa;
	}

	void seta(const T& a) {
		pa = a;
	}
};

template<typename T>
class B {
private:
	T pb;

public:
	B(T b) : pb(b) {}
	T getb() const {
		return pb;
	}

	void setb(const T& b) {
		pb = b;
	}
};

int main()
{
	A<string> a("This is A"s);
	B<string> b("This is B"s);

	cout << "a = " << a.geta() << ", b = " << b.getb() << endl;
	b.setb(a.geta());
	cout << "a = " << a.geta() << ", b = " << b.getb() << endl;
}
This displays
Code:
a = This is A, b = This is B
a = This is A, b = This is A
as the private variable of B has been set to that of A.

I want to perfom as I asked my previous question how to get text of selected item in list control

1] Select one iteam in list control
2] store it into variable
3] access that variable with it's containing value into other class (which I have to pass to SQLquery in code )

now just want to know that how pass that value and get into other class ?