记录详情

Compile Error

/in/foo.cc: In member function 'void Str::Index(char*, int, char*)':
/in/foo.cc:39:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   return i-j;
            ^
/in/foo.cc:41:11: error: return-statement with a value, in function returning 'void' [-fpermissive]
   return -1;
           ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:47:13: error: conflicting declaration 'char s [1000]'
  char s[1000];
             ^
/in/foo.cc:46:6: note: previous declaration as 'Str s'
  Str s;
      ^
/in/foo.cc:49:9: error: expected primary-expression before ']' token
  cin>>s[];
         ^
/in/foo.cc:50:9: error: expected primary-expression before ']' token
  cin>>t[];
         ^
/in/foo.cc:52:19: error: 'strlen' was not declared in this scope
  int tlen=strlen(t);
                   ^
/in/foo.cc:56:22: error: 'Index' was not declared in this scope
   k=Index(s,k+tlen, t);
                      ^
/in/foo.cc:61:10: error: no matching function for call to 'Str::Index()'
  s.Index();
          ^
/in/foo.cc:28:6: note: candidate: void Str::Index(char*, int, char*)
 void Str::Index(char s[], int si, char t[])
      ^~~
/in/foo.cc:28:6: note:   candidate expects 3 arguments, 0 provided

信息

递交者
类型
自测
题目
DS3-1 字符串的模式匹配
语言
C++
递交时间
2019-04-06 11:54:49
评测时间
2019-04-06 11:54:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes