Compile Error

foo.cc: In function 'void mycopy(char*, char, int, int)':
foo.cc:6:13: error: invalid types 'char[int]' for array subscript
   s1[k]=s2[i];
             ^
foo.cc: In function 'int count(char*, int, char*, int)':
foo.cc:15:19: error: invalid conversion from 'char*' to 'char' [-fpermissive]
   mycopy(t,s2,i,n1);
                   ^
foo.cc:3:6: note:   initializing argument 2 of 'void mycopy(char*, char, int, int)'
 void mycopy(char s1[],char s2,int index,int n){
      ^~~~~~
foo.cc: In function 'int main()':
foo.cc:32:7: error: expected '(' before '{' token
  while{
       ^
foo.cc:32:7: error: expected primary-expression before '{' token
foo.cc:32:7: error: expected ')' before '{' token
foo.cc:34:4: error: 'mycope' was not declared in this scope
    mycope(t,s2,i,L);
    ^~~~~~
foo.cc:34:4: note: suggested alternative: 'mycopy'
    mycope(t,s2,i,L);
    ^~~~~~
    mycopy
foo.cc:24:10: warning: unused variable 'n1' [-Wunused-variable]
  int num,n1,n2,L,k,n;
          ^~
foo.cc:27:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&x);
   ~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1159 最长重复子串
语言
C++
递交时间
2021-11-28 17:05:43
评测时间
2021-11-28 17:05:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes