记录详情

Compile Error

foo.cc: In function 'int number(char*, char*, char*)':
foo.cc:14:15: error: 'szline' was not declared in this scope; did you mean 'szline2'?
   14 |   int szline2=szline[j-1];
      |               ^~~~~~
      |               szline2
foo.cc:15:7: error: redeclaration of 'int szline2'
   15 |   int szline2=szline[j];
      |       ^~~~~~~
foo.cc:14:7: note: 'int szline2' previously declared here
   14 |   int szline2=szline[j-1];
      |       ^~~~~~~
foo.cc:14:7: warning: unused variable 'szline2' [-Wunused-variable]
foo.cc:18:9: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   18 |  return szline3
      |         ^~~~~~~
      |         |
      |         char*
foo.cc:18:16: error: expected ';' before '}' token
   18 |  return szline3
      |                ^
      |                ;
   19 | }
      | ~               
foo.cc: In function 'int main()':
foo.cc:22:24: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   22 |  cout<<number(szline1[N],szline2[N],szline3[N])
      |               ~~~~~~~~~^
      |                        |
      |                        char
foo.cc:7:17: note:   initializing argument 1 of 'int number(char*, char*, char*)'
    7 | int number(char szline1[N],char szline2[N],char szline3[N])
      |            ~~~~~^~~~~~~~~~
foo.cc:22:35: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   22 |  cout<<number(szline1[N],szline2[N],szline3[N])
      |                          ~~~~~~~~~^
      |                                   |
      |                                   char
foo.cc:7:33: note:   initializing argument 2 of 'int number(char*, char*, char*)'
    7 | int number(char szline1[N],char szline2[N],char szline3[N])
      |                            ~~~~~^~~~~~~~~~
foo.cc:22:46: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   22 |  cout<<number(szline1[N],szline2[N],szline3[N])
      |                                     ~~~~~~~~~^
      |                                              |
      |                                              char
foo.cc:7:49: note:   initializing argument 3 of 'int number(char*, char*, char*)'
    7 | int number(char szline1[N],char szline2[N],char szline3[N])
      |                                            ~~~~~^~~~~~~~~~
foo.cc:22:48: error: expected ';' before '}' token
   22 |  cout<<number(szline1[N],szline2[N],szline3[N])
      |                                                ^
      |                                                ;
   23 | }
      | ~                                               
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
比赛
2022暑期青少年社团(训练赛)
语言
C++
递交时间
2022-08-07 19:45:39
评测时间
2022-08-07 19:45:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes