|
From: | Shigio YAMAGUCHI |
Subject: | Re: Searching for members of classes |
Date: | Mon, 16 Jun 2014 07:42:48 +0900 |
Hello,
Consider following partial code:
/* 1 */ class A
/* 2 */ {
/* 3 */ int x;
/* 4 */ void fun();
/* 5 */ }
/* 6 */ A::fun() { std::cout << x << "\n"; }
/* 7 */
/* 8 */ class B
/* 9 */ {
/* 10 */ int x;
/* 11 */ void fun();
/* 12 */ }
/* 13 */ B::fun() { std::cout << x*x << "\n"; }
/* 14 */
/* 15 */ main()
/* 16 */ {
/* 17 */ A u;
/* 18 */ B v;
/* 19 */
/* 20 */ u.x = 3;
/* 21 */ u.fun();
/* 22 */
/* 23 */ v.x = 5;
/* 24 */ v.fun();
/* 25 */ }
How to find all of A's x and only A's x: lines 3, 6, 20?
How to find all of A's fun() and only A's fun(): lines 4, 6, 21?
Thanks,
--Suresh
_______________________________________________
Help-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-global
[Prev in Thread] | Current Thread | [Next in Thread] |