SHOW:
|
|
- or go back to the newest paste.
| 1 | lab08.cpp: In function ‘int main()’: | |
| 2 | lab08.cpp:10:23: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::string&)’ | |
| 3 | ifstream giveit(file); | |
| 4 | ^ | |
| 5 | lab08.cpp:10:23: note: candidates are: | |
| 6 | In file included from lab08.cpp:2:0: | |
| 7 | /usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] | |
| 8 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) | |
| 9 | ^ | |
| 10 | /usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
| |
| 11 | /usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>] | |
| 12 | basic_ifstream() : __istream_type(), _M_filebuf() | |
| 13 | ^ | |
| 14 | /usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided | |
| 15 | /usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&) | |
| 16 | class basic_ifstream : public basic_istream<_CharT, _Traits> | |
| 17 | ^ | |
| 18 | /usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const std::basic_ifstream<char>&’
| |
| 19 | lab08.cpp:24:43: error: expected primary-expression before ‘<<’ token | |
| 20 | cout<<"The name is: "<< file << <<endl; | |
| 21 | ^ | |
| 22 | jordan@jordan-MacBookAir:~/labs/lab08$ g++ -o lab08 lab08.cpp | |
| 23 | lab08.cpp: In function ‘int main()’: | |
| 24 | lab08.cpp:10:23: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::string&)’ | |
| 25 | ifstream giveit(file); | |
| 26 | ^ | |
| 27 | lab08.cpp:10:23: note: candidates are: | |
| 28 | In file included from lab08.cpp:2:0: | |
| 29 | /usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] | |
| 30 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) | |
| 31 | ^ | |
| 32 | /usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
| |
| 33 | /usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>] | |
| 34 | basic_ifstream() : __istream_type(), _M_filebuf() | |
| 35 | ^ | |
| 36 | /usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided | |
| 37 | /usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&) | |
| 38 | class basic_ifstream : public basic_istream<_CharT, _Traits> | |
| 39 | ^ | |
| 40 | /usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const std::basic_ifstream<char>&’
| |
| 41 | lab08.cpp:24:43: error: expected primary-expression before ‘<<’ token | |
| 42 | cout<<"The name is: "<< file << <<endl; | |
| 43 | ^ |