Record Detail

Compile Error

In file included from /in/compile/ex2.cpp:1:0:
/in/ex2.h: In function 'int hex2decLinkedList(Node*)':
/in/ex2.h:26:5: error: 'string' was not declared in this scope
     string a="";
     ^~~~~~
/in/ex2.h:26:5: note: suggested alternatives:
In file included from /usr/include/c++/7/iosfwd:39:0,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/ex2.h:5,
                 from /in/compile/ex2.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
In file included from /in/compile/ex2.cpp:1:0:
/in/ex2.h:31:9: error: 'a' was not declared in this scope
         a+=p->val;
         ^
/in/ex2.h:34:5: error: 'stringstream' was not declared in this scope
     stringstream ss2;
     ^~~~~~~~~~~~
/in/ex2.h:34:5: note: suggested alternative:
In file included from /usr/include/c++/7/ios:38:0,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/ex2.h:5,
                 from /in/compile/ex2.cpp:1:
/usr/include/c++/7/iosfwd:156:37: note:   'std::stringstream'
   typedef basic_stringstream<char>  stringstream;
                                     ^~~~~~~~~~~~
In file included from /in/compile/ex2.cpp:1:0:
/in/ex2.h:36:5: error: 'ss2' was not declared in this scope
     ss2 << hex << a;
     ^~~
/in/ex2.h:36:12: error: 'hex' was not declared in this scope
     ss2 << hex << a;
            ^~~
/in/ex2.h:36:12: note: suggested alternative:
In file included from /usr/include/c++/7/ios:42:0,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/ex2.h:5,
                 from /in/compile/ex2.cpp:1:
/usr/include/c++/7/bits/ios_base.h:1024:3: note:   'std::hex'
   hex(ios_base& __base)
   ^~~
In file included from /in/compile/ex2.cpp:1:0:
/in/ex2.h:36:19: error: 'a' was not declared in this scope
     ss2 << hex << a;
                   ^
/in/ex2.h:28:10: error: unused variable 'q' [-Werror=unused-variable]
     Node*q;
          ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Final Exam
Language
C++
Submit At
2022-08-02 15:16:00
Judged At
2022-08-06 15:13:54
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes