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

 

 ·c++简单问题 100分    »显示摘要«
    摘要: 偶有三个文件: //1.cpp #include <iostream.h> #include "1head.h" void main() { temp a; cout<<"ok"<<endl; a.i=4; a.print(); } //1head.h class temp{ public: void p......
 ·如何往数据库中插入数据    »显示摘要«
    摘要: 字段2为数值类型,字段3为date类型,下面这段代码改怎么写? dim conn as new adodb.connection conn.open connectstring conn.execute "insert into a(字段1,字段2,字段3) value(" + sheet_no + "," + num + ","......


有关“<<“重载问题

程序代码如下:  
  #include   <iostream>  
  using   namespace   std;  
  class   LibMat{  
  public   :  
  LibMat(){  
  cout<<"LibMat::LibMat()   default   constructor!\n";  
  }  
  virtual   ~LibMat()  
  {  
  cout<<"LibMat::LibMat()   destructor!\n";  
  }  
  virtual   void   print()const  
  {  
  cout<<"LibMat::print()____I   am   a   LibMat   object!\n";  
   
  }  
   
  };  
  void   print(const   LibMat   &mat)  
  {  
  cout<<"in   global   print():about   to   print   mat.print()\n";  
  mat.print();  
  }  
  class   Book:public   LibMat  
  {  
  public:  
  Book(const   string   &title,const   string   &author)  
  :_title(title),_author(author)//////逐一成员初始化  
  {  
                 
                cout<<"Book::Book   cnostructor\n";  
  }  
          virtual   ~Book()  
  {  
  cout<<"Book::Book()   destructor\n";  
  }  
          virtual   void   print()const  
  {          
  string     _title;  
  string   _author;  
  cout<<"I   am   a   book   object!\n";  
  cout<<"title"<<_title<<"\n";////////////////////////_title??  
  cout<<"author"<<_author<<endl;///////////////////////出错位置  
   
  }  
  const   string&   title()const{  
  return   _title;  
  }  
  const   string&   author()const{  
  return   _author;  
  }  
  protected:  
  string   _title;  
  string   _author;  
  };  
  int   main()  
  {  
   
          cout<<"Test   Book::Book!\n";  
                  Book   test("Spring",   "Charles");        
                  print(test);    
  return   0;  
  }  
   
   
  vc++6.0编译报错“binary   <<   :   no   operator   defined”  
  请问如何修改

NO.1   作者: aflyinghorse

加上  
  #include   <string>


 ·关于注销时框架的问题    »显示摘要«
    摘要: 点击注销时如何重装整个框架呢?我现在的效果是在框架内出先了登陆界面,我想要的结果是点注销后只出现登陆界面,不能出项框架界面,谢谢 ......
» 本期热门文章:

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