Pisze program w c++ ( nie wiem czy jego kod jest w c++ )
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream plik("lala.png", ifstream::binary);
unsigned char c;
cout << setbase(16);
while(!plik.get(c).eof())
cout << (int)c;
}
A to wypluwa bash;
wojtek@wojtek-desktop:~/Desktop$ g++ main.cpp -o program
main.cpp: In function ‘int main()’:
main.cpp:8: error: ‘setbase’ was not declared in this scope
main.cpp:9: error: no matching function for call to ‘std::basic_ifstream<char, std::char_traits<char> >::get(unsigned char&)’
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:272: note: candidates are: typename std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get() [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:286: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(_CharT&) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:313: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(_CharT*, std::streamsize, _CharT) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:324: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(_CharT*, std::streamsize) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:347: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_streambuf<_CharT, _Traits>&, _CharT) [with _CharT = char, _Traits = std::char_traits<char>]
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/istream:357: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]
wojtek@wojtek-desktop:~/Desktop$