int x, y;
In func1, how to access variables x or y defined in class A?
/EDIT M - Looks like a repost
Create an instance class A and access them. My C++ may be a little rusty, but that's the jist of it.
A a = new A();
a.x = ...
a.y = ...
Just because you have an instance of B in A doesn't mean you can automatically access anything in A from B. Personally I would probabably pass the values to func1
func1(int x, int y)
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)