当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 如题 ......
    摘要: 小兄弟向你请教,如何捕获 if key=key_period then begin re:=application.messagebox(该项必须为整数,请更正!,警告,mb_ok+mb_iconinformation); exit; end; 帮个忙吧? ......


》》》高手来看看这个问题,编译器错误,搞不懂了。《〈〈

#include   <iostream>  
   
  using   namespace   std;  
   
  class   A  
  {  
   
  int   i;  
  public:  
   
  A()  
  {  
  i   =   11;  
  }  
  int   geti(void)  
  {  
  return   i;  
  }  
  };  
   
  int   fun(void)  
  {  
  return   1;  
  }  
   
  int   main()  
  {  
  A   *pA   =   new   A[4];  
   
  for   (int   i   =   0;   i   <   4;   i   ++)  
  {  
  cout   <<   pA[i].geti()   <<   endl;  
  cout   <<   pA+i   <<   endl;  
  cout   <<   pA[i].geti   <<   endl; //编译器内部错误  
  cout   <<   fun   <<   endl;         //没有错误  
  }  
   
  delete   []   pA;  
   
  cout   <<   pA[0].geti()   <<   endl;  
  cout   <<   pA   <<   endl;  
   
  return   0;  
  }  
   
  错误内容如下:  
   
  --------------------Configuration:   Test   -   Win32   Debug--------------------  
  Compiling...  
  main.cpp  
  D:\MyVSProjects\VC\Test\main.cpp(34)   :   fatal   error   C1001:   INTERNAL   COMPILER   ERROR  
                  (compiler   file   msc1.cpp,   line   1786)    
                    Please   choose   the   Technical   Support   command   on   the   Visual   C++    
                    Help   menu,   or   open   the   Technical   Support   help   file   for   more   information  
  Error   executing   cl.exe.  
   
  Test.exe   -   1   error(s),   0   warning(s)

NO.1   作者: coldcrane

这里不对啊!  
  cout   <<   pA[i].geti   <<   endl; //编译器内部错误  
  该:    
  cout   <<   pA[i].geti()   <<   endl;

NO.2   作者: ywls

再你标示“//编译器内部错误”的那一行,居然是cout   <<   pA[i].geti   <<   endl;  
  你的geti是一个函数,必须用geti()调用。我已经调试通过,但结果对不对就你自己看了。

NO.3   作者: WarFather

cout   <<   pA[i].geti   <<   endl;     ????  
   
   
  try  
   
  cout   <<   pA[i].geti()   <<   endl;

NO.4   作者: IT_worker

那你用  
  cout<<A::geti<<endl  
  试一试

NO.5   作者: cycker

如此看来  
  成员函数的地址是隐藏起来的  
 

NO.6   作者: sjie_ji

这个用法没有见过,用   .*或者->*试试

NO.7   作者: chinaeagle

我运行的时候没有问题啊???  
        我用的编译器是devcpp  
        输出结果如下:  
        11  
        0x473880  
        11  
        1  
         
        11  
        0x473884  
        11  
        1  
       
        11  
        0x473888  
        11  
        1  
         
        11  
        0x4738c  
        11  
        1  
   
        0  
        0x473880  
         
   
   
 

NO.8   作者: hz129

cout   <<   &A::geti   <<   endl;


 ·表格问题    »显示摘要«
    摘要: 一个大表格,没办法细分成小表格,但它在显示的时候速度却很慢,用<tbody>的话表格就会出现错位,请问各位还有其它的解决办法吗??? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE