fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. void solve(string dic[])
  4. {
  5. for(auto &i:dic){
  6. cout<<i<<endl;
  7. }
  8. }
  9. int main()
  10. {
  11. string dic[] = {"hello ","india","go"};
  12. solve(dic);
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void solve(std::__cxx11::string*)’:
prog.cpp:5:14: error: no matching function for call to ‘begin(std::__cxx11::basic_string<char>*&)’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from prog.cpp:1:
/usr/include/c++/6/valarray:1206:5: note: candidate: template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)
     begin(const valarray<_Tp>& __va)
     ^~~~~
/usr/include/c++/6/valarray:1206:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘const std::valarray<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from prog.cpp:1:
/usr/include/c++/6/valarray:1196:5: note: candidate: template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)
     begin(valarray<_Tp>& __va)
     ^~~~~
/usr/include/c++/6/valarray:1196:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘std::valarray<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/bits/range_access.h:87:5: note: candidate: template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
/usr/include/c++/6/bits/range_access.h:87:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘_Tp [_Nm]’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/bits/range_access.h:58:5: note: candidate: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^~~~~
/usr/include/c++/6/bits/range_access.h:58:5: note:   template argument deduction/substitution failed:
/usr/include/c++/6/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::__cxx11::basic_string<char>*]’:
prog.cpp:5:14:   required from here
/usr/include/c++/6/bits/range_access.h:58:56: error: request for member ‘begin’ in ‘__cont’, which is of pointer type ‘std::__cxx11::basic_string<char>* const’ (maybe you meant to use ‘->’ ?)
     begin(const _Container& __cont) -> decltype(__cont.begin())
                                                 ~~~~~~~^~~~~
/usr/include/c++/6/bits/range_access.h:48:5: note: candidate: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^~~~~
/usr/include/c++/6/bits/range_access.h:48:5: note:   template argument deduction/substitution failed:
/usr/include/c++/6/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::__cxx11::basic_string<char>*]’:
prog.cpp:5:14:   required from here
/usr/include/c++/6/bits/range_access.h:48:50: error: request for member ‘begin’ in ‘__cont’, which is of pointer type ‘std::__cxx11::basic_string<char>*’ (maybe you meant to use ‘->’ ?)
     begin(_Container& __cont) -> decltype(__cont.begin())
                                           ~~~~~~~^~~~~
In file included from /usr/include/c++/6/bits/range_access.h:36:0,
                 from /usr/include/c++/6/string:51,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/initializer_list:89:5: note: candidate: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^~~~~
/usr/include/c++/6/initializer_list:89:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
prog.cpp:5:14: error: no matching function for call to ‘end(std::__cxx11::basic_string<char>*&)’
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from prog.cpp:1:
/usr/include/c++/6/valarray:1226:5: note: candidate: template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)
     end(const valarray<_Tp>& __va)
     ^~~
/usr/include/c++/6/valarray:1226:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘const std::valarray<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from prog.cpp:1:
/usr/include/c++/6/valarray:1216:5: note: candidate: template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)
     end(valarray<_Tp>& __va)
     ^~~
/usr/include/c++/6/valarray:1216:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘std::valarray<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/bits/range_access.h:97:5: note: candidate: template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^~~
/usr/include/c++/6/bits/range_access.h:97:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘_Tp [_Nm]’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/bits/range_access.h:78:5: note: candidate: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^~~
/usr/include/c++/6/bits/range_access.h:78:5: note:   template argument deduction/substitution failed:
/usr/include/c++/6/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = std::__cxx11::basic_string<char>*]’:
prog.cpp:5:14:   required from here
/usr/include/c++/6/bits/range_access.h:78:54: error: request for member ‘end’ in ‘__cont’, which is of pointer type ‘std::__cxx11::basic_string<char>* const’ (maybe you meant to use ‘->’ ?)
     end(const _Container& __cont) -> decltype(__cont.end())
                                               ~~~~~~~^~~
/usr/include/c++/6/bits/range_access.h:68:5: note: candidate: template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^~~
/usr/include/c++/6/bits/range_access.h:68:5: note:   template argument deduction/substitution failed:
/usr/include/c++/6/bits/range_access.h: In substitution of ‘template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = std::__cxx11::basic_string<char>*]’:
prog.cpp:5:14:   required from here
/usr/include/c++/6/bits/range_access.h:68:48: error: request for member ‘end’ in ‘__cont’, which is of pointer type ‘std::__cxx11::basic_string<char>*’ (maybe you meant to use ‘->’ ?)
     end(_Container& __cont) -> decltype(__cont.end())
                                         ~~~~~~~^~~
In file included from /usr/include/c++/6/bits/range_access.h:36:0,
                 from /usr/include/c++/6/string:51,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from prog.cpp:1:
/usr/include/c++/6/initializer_list:99:5: note: candidate: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^~~
/usr/include/c++/6/initializer_list:99:5: note:   template argument deduction/substitution failed:
prog.cpp:5:14: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘std::__cxx11::basic_string<char>*’
  for(auto &i:dic){
              ^~~
stdout
Standard output is empty