Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
long lSize;
char * buffer;
lSize = 10504120
ifstream in;
in.open (fileName);
filebuf *pbuf;
pbuf=in.rdbuf();
pbuf->sgetn (buffer,lSize);
cout << "Buffer Size:" << sizeof(buffer) << endl;
cout << "PBuffer Size:" << sizeof(pbuf) << endl;
#include <string>
std::ifstream in(fileName);
std::ostringstream tmp;
tmp << in.rdbuf();
std::string str = tmp.str();
ofstream out ("test.txt",ofstream::binary)
{
char *buff;
long size;
ifstream infile (fileName);
infile.seekg(0,ifstream::end);
size=infile.tellg();
infile.seekg(0);
buff = new char [size];
infile.read(buff,lSize);
std::ostringstream out;
out.write (buff,lSize);
std::string mystr = out.str();
}
#include <string>
std::ifstream in(fileName);
std::ostringstream tmp;
tmp << in.rdbuf();
std::string str = tmp.str();
And I get these of compilation errors:
D:\DOCs\inetConsole\inetConsole.cpp(307) : error C2079: 'in' uses undefined class 'basic_ifstream<char,struct std::char_traits<char> >'
D:\DOCs\inetConsole\inetConsole.cpp(307) : error C2440: 'initializing' : cannot convert from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\DOCs\inetConsole\inetConsole.cpp(308) : error C2079: 'tmp' uses undefined class 'basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >'
D:\DOCs\inetConsole\inetConsole.cpp(309) : error C2228: left of '.rdbuf' must have class/struct/union type
D:\DOCs\inetConsole\inetConsole.cpp(310) : error C2228: left of '.str' must have class/struct/union type
D:\DOCs\inetConsole\inetConsole.cpp(324) : error C2228: left of '.eof' must have class/struct/union type
#include <fstream.h>