/in/foo.cc: In function 'int main()':
/in/foo.cc:8:15: error: no matching function for call to 'getline(std::__cxx11::string&, std::istream&)'
getline(a,cin);
^
In file included from /usr/include/stdio.h:935:0,
from /usr/include/c++/6/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:46,
from /in/foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate: __ssize_t getline(char**, size_t*, FILE*)
getline (char **__lineptr, size_t *__n, FILE *__stream)
^~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/6/string:52: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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:5395:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
getline(basic_istream<_CharT, _Traits>&& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5395:5: note: template argument deduction/substitution failed:
/in/foo.cc:8:15: note: 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
getline(a,cin);
^
In file included from /usr/include/c++/6/string:52: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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:5388:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
getline(basic_istream<_CharT, _Traits>&& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5388:5: note: template argument deduction/substitution failed:
/in/foo.cc:8:15: note: 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
getline(a,cin);
^
In file included from /usr/include/c++/6/string:52: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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:5380:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
getline(basic_istream<_CharT, _Traits>& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5380:5: note: template argument deduction/substitution failed:
/in/foo.cc:8:15: note: 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
getline(a,cin);
^
In file included from /usr/include/c++/6/string:53: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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.tcc:1509:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
getline(basic_istream<_CharT, _Traits>& __in,
^~~~~~~
/usr/include/c++/6/bits/basic_string.tcc:1509:5: note: template argument deduction/substitution failed:
/in/foo.cc:8:15: note: 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
getline(a,cin);
^
/in/foo.cc:9:6: error: conflicting declaration 'int a'
int a,b;cin>>a>>b;
^
/in/foo.cc:7:9: note: previous declaration as 'std::__cxx11::string a'
string a;
^
/in/foo.cc:10:20: error: no matching function for call to 'std::__cxx11::basic_string<char>::substr(std::__cxx11::string&, int&)'
cout<<a.substr(a,b);
^
In file included from /usr/include/c++/6/string:52: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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:2398:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
substr(size_type __pos = 0, size_type __n = npos) const
^~~~~~
/usr/include/c++/6/bits/basic_string.h:2398:7: note: no known conversion for argument 1 from 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'std::__cxx11::basic_string<char>::size_type {aka long unsigned int}'