Hi I was wandering the C++ STL's reference and I think I'm missing something
Actually I have a InputStream (ifstream) and I want to read exactly N characters from the stream, but I don't want to put them into a char[N] buffer, but I want to put them inside a std::string (eventually by first calling "str.resize(N)")
Wich is the fastest way for doing that?
actually I'm doing
for( int i=0;i<N;i++){
char c;
file->read(&c,sizeof(char));
str.push_back(c);
}
but it is really really slow :(