Searching for members of classes

Suresh Govindachar <[email protected]> Sat, 14 Jun 2014 07:49:14 -0700
Newsgroups gmane.comp.gnu.global.general
Message-ID <[email protected]>
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