fork download
  1. #include <iomanip>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. void ToXmlStream(std::ostream& os)
  7. {
  8. std::string strQuery;
  9. os << "<query>" << strQuery << "</query>";
  10. }
  11.  
  12. int main() {
  13. // your code goes here
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 3452KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'void ToXmlStream(std::ostream&)':
prog.cpp:9:5: error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'const char [8]')
  os << "<query>" << strQuery << "</query>";
     ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/iomanip:40,
                 from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5170:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator<<(basic_ostream<_CharT, _Traits>& __os,
     ^
/usr/include/c++/5/bits/basic_string.h:5170:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'const char [8]'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:79:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Resetiosflags)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
     ^
/usr/include/c++/5/iomanip:79:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   cannot convert '"<query>"' (type 'const char [8]') to type 'std::_Resetiosflags'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:109:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setiosflags)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
     ^
/usr/include/c++/5/iomanip:109:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   cannot convert '"<query>"' (type 'const char [8]') to type 'std::_Setiosflags'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:143:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setbase)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
     ^
/usr/include/c++/5/iomanip:143:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   cannot convert '"<query>"' (type 'const char [8]') to type 'std::_Setbase'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:178:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setfill<_CharT>)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
     ^
/usr/include/c++/5/iomanip:178:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   mismatched types 'std::_Setfill<_CharT>' and 'const char*'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:208:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setprecision)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
     ^
/usr/include/c++/5/iomanip:208:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   cannot convert '"<query>"' (type 'const char [8]') to type 'std::_Setprecision'
  os << "<query>" << strQuery << "</query>";
        ^
In file included from prog.cpp:1:0:
/usr/include/c++/5/iomanip:238:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setw)
     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
     ^
/usr/include/c++/5/iomanip:238:5: note:   template argument deduction/substitution failed:
prog.cpp:9:8: note:   cannot convert '"<query>"' (type 'const char [8]') to type 'std::_Setw'
  os << "<query>" << strQuery << "</query>";
        ^
stdout
Standard output is empty