1。C++编译时,出现这样的错误

d:\program files\microsoft visual studio\vc98\include\stdio.h(36) : error C2143: syntax error : missing ';' before 'string'
d:\program files\microsoft visual studio\vc98\include\stdio.h(36) : fatal error C1004: unexpected end of file found

  一般是c++在定义头文件是,少掉了;比如类的定义时,

     class  temp {

          private : 

          public : 这两部分

} ;  ----这个;分号少掉了,便会出现这样的结果。

 

3.    error C2065: '_beginthread' : undeclared identifier

 VC多线程编程时,在include process.h的情况下,还会出error C2065: '_beginthread' : undeclared identifier

这样的error信息。主要是配置文件的问题。



Project -> Settings... 中
选C/C++ 的页,然后在Category中选Code Generation
然在它下面的Use run-time libaray 中选Multithreaded(或 Multithreader DLL
或 Debug Multithreader DLL 或 Debug Multithreader )

保存settings,再 build 一次就ok了.

4. rror C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

    http://jingyan.baidu.com/article/ce436649fd61543773afd32e.html

5. 出现这种错误提示时:

      Severity Code Description Project File Line

Error error LNK2019: unresolved external symbol "public: __thiscall CSendMail::CSendMail(void)" (??0CSendMail@@QAE@XZ) referenced in function "public: void __thiscall CE_MailMFCDlg::TestSendMail(void)" (?TestSendMail@CE_MailMFCDlg@@QAEXXZ) E_MailMFC E_MailMFCDlg.obj

    -------没有定义声明的类! 解决办法,定义那些函数

 后缀数组: 模板

  1 /*  
  2   titie: hdu 3518
  3   author: Gxjun
  4 */
  5 
  6 #include<stdio.h>
  7 #include<string.h>
  8 #include<stdlib.h>
  9 
 10 const int MAXN = 20010 ;
 11 int t1[MAXN],t2[MAXN],c[MAXN] ;  
 12 
 13 bool cmp(int *ra , int a , int b , int lr){
 14    
 15     return ra[a] == ra[b] && ra[a+1] == ra[b+1];
 16 }
 17 
 18 void swap(char *x , char *y){
 19     
 20     if(*x == *y) return ;
 21      *x^=*y,*y^=*x,*x^=*y;
 22 }
 23 
 24 // das算法
 25 
 26 void da(int str [] , int sa[] , int rank[] , int height[] , int n , int m)
 27 {
 28       n++;
 29     //基数排序
 30     int i,j,p, *x=t1 , *y =t2 ;
 31     for(i=0 ; i<m ; i++ ) c[i]=0;
 32     for(i=0 ; i<n ; i++ ) c[x[i]=str[i]]++;
 33     for(i=1 ; i<m ; i++ ) c[i] += c[i-1];
 34     for(i=n-1 ; i>=0 ; i--) sa[--c[x[i]]]=i;
 35     for(j=1 ; j<=n ; j++){
 36        p=0 ;
 37        for(i=n-j ; i<n ; i++ ) y[p++]=i ;
 38        for(i =0  ; i<n ; i++ ) 
 39          if(sa[i]>= j) y[p++] = sa[i] -j ;
 40 
 41        for(i=0; i<m ;i++)  c[i]=0;
 42        for(i=0; i<n ;i++)  c[x[y[i]]]++;
 43        for(i=1; i<m ;i++)  c[i] += c[i-1];
 44        
 45        for(i = n-1 ; i>=0 ; i--)
 46          sa[--c[x[y[i]]]] = y[i] ;
 47       
 48        while(i<strlen(x)||i<strlen(y))
 49            swap(x[i],y[i]);
 50        p=1;
 51        x[sa[0]]=0;
 52        for(i=1 ; i<n ;i++)
 53            x[sa[i]] = cmp(y, sa[i-1],sa[i],j)?p-1:p++;
 54        if(p >= n) break;
 55        m = p;
 56     }
 57     int k = 0;
 58     n-- ;
 59     for(i=0 ; i<= n ; i++)
 60          rank[sa[i]]=i;
 61     for(i=0 ; i<n ;i++)
 62     {
 63         if(k) k-- ;
 64         j = sa[rank[i] - 1] ;
 65         while(str[i+k] == str[j+ k])
 66             k++;
 67         height[rank[i]]=k;
 68     }
 69 
 70    return ;
 71 }
 72 
 73 int rank[MAXN] , height[MAXN] ;
 74 
 75 int RMQ[MAXN];
 76 int mm[MAXN];
 77 int best[20][MAXN];
 78 
 79 void init(int n){
 80   
 81     mm[0]=1;
 82   for(int i=1 ; i<=n ; i++)
 83       mm[i] = ((i&(i-1))==0)?mm[i-1]+1:mm[i-1];
 84   for(int i=1; i<=n ;i++) best[0][i]=i;
 85   for(int i=1 ; i<=mm[n] ; i++)
 86       for(int j=1 ; j+(1<<i) -1<=n ;j++){
 87           int a = best[i-1][j];
 88           int b = best[i-1][j+(1<<(i-1))];
 89           if(RMQ[a] <RMQ[b] ) best[i][j] =a;
 90           else best[i][j]=b;
 91       }
 92 }
 93 
 94 int askRMQ(int a , int b){
 95 
 96     int t;
 97     t =mm[b-a+1];
 98     b-=best[t][a];
 99     a = best[t][a];
100     b = best[t][b];
101 }
102 int main(int argc , char * argv [] ){
103 
104   return 0;
105 }
View Code

相关文章:

  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
猜你喜欢
  • 2021-06-10
  • 2021-12-16
  • 2021-08-04
  • 2021-08-13
  • 2021-10-01
  • 2022-12-23
相关资源
相似解决方案