记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:39:22: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[15]' [-Wformat=]
         scanf("%s",&x);
                    ~~^
foo.cc:40:14: error: reference to 'hash' is ambiguous
         a[i]=hash(x);
              ^~~~
foo.cc:14:12: note: candidates are: ULL hash(char*)
 inline ULL hash(char st[MAXC]) {
            ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
foo.cc:44:22: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[15]' [-Wformat=]
         scanf("%s",&x);
                    ~~^
foo.cc:45:14: error: reference to 'hash' is ambiguous
         t[i]=hash(x);
              ^~~~
foo.cc:14:12: note: candidates are: ULL hash(char*)
 inline ULL hash(char st[MAXC]) {
            ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6587:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
foo.cc:37:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
foo.cc:39:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",&x);
         ~~~~~^~~~~~~~~
foo.cc:42:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&m);
     ~~~~~^~~~~~~~~
foo.cc:44:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",&x);
         ~~~~~^~~~~~~~~

自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)
正在同步测试数据,请稍后

信息

递交者
类型
递交
题目
单词背诵
题目数据
下载
语言
C++
递交时间
2019-02-19 18:36:06
评测时间
2020-08-10 11:04:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes