以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 C/C++编程思想 』  (http://bbs.xml.org.cn/list.asp?boardid=61)
----  如何查看成员函数的地址?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=61&rootid=&id=86342)


--  作者:vfdff
--  发布时间:8/20/2010 1:03:00 AM

--  如何查看成员函数的地址?
1. #include
   2. class TestClass
   3. {
   4.                 public :
   5.                 int test1(int a) { return a<<2; }       
   6. }testclass;
   7.

   8. int main(int argc,char** argv)
   9. {           
  10.     printf("test generic member function!\n");
  11.     printf("value = %d\n", &testclass.test1 );
  12.

  13.     return 0;
  14. }
我想看看成员函数test1的地址,为什么不能使用printf显示出来呢?


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms