Here's a simple file program i have been testing to learn some file manipulation..
But im getting this errorCode:#include <iostream> #include <string> #include <sstream> #include <fstream> using namespace std; int main() { string filepath; ofstream outputfile ("output.txt", ios::out | ios::app | ios::binary); cout << "File Copier =P" << endl; cout << "Input file name: "; cin >> filepath; ifstream inputfile (filepath, ios::in | ios::binary); inputfile.open(filepath); if (inputfile.is_open()) { long begin, end, total; int parts; char * memblock; begin = inputfile.tellg(); inputfile.seekg (0, ios::end); end = inputfile.tellg(); total = end-begin; inputfile.seekg (0, ios::beg); total = total/1024; if(total != 0) { parts = total; } else { parts = 1; } for(int i=0;i<parts;i++) { inputfile.read (memblock, 1024); outputfile.write(memblock, 1024); delete[] memblock; } inputfile.close(); outputfile.close(); return 0; } }
From spanish to english..
"no se encontró una función coincidente para la llamada a" -> a function as the written there wasn't found
" los candidatos son: " -> the candidates are
Any help?Code:helloworld.cpp: In function ‘int main()’: helloworld.cpp:15: error: no se encontró una función coincidente para la llamada a ‘std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::string&, std::_Ios_Openmode)’ /usr/include/c++/4.2/fstream:464: nota: los candidatos son: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>] /usr/include/c++/4.2/fstream:450: nota: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char, _Traits = std::char_traits<char>] /usr/include/c++/4.2/iosfwd:89: nota: std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(const std::basic_ifstream<char, std::char_traits<char> >&) helloworld.cpp:16: error: no se encontró una función coincidente para la llamada a ‘std::basic_ifstream<char, std::char_traits<char> >::open(std::string&)’ /usr/include/c++/4.2/fstream:517: nota: los candidatos son: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]



LinkBack URL
About LinkBacks



