G
g3rc4n
what is the best way to have a buffer in a function, for a (real)
example say a member function
std::string read(int offset, int nbytes){
static const char buffer_size(1024);
static char buffer[buffer_size];
:read(file_desc,buffer,buffer_size,nbytes,offset);
return(std::string(buffer));
}
over pushing it on the stack or dynamically allocating it
example say a member function
std::string read(int offset, int nbytes){
static const char buffer_size(1024);
static char buffer[buffer_size];
:read(file_desc,buffer,buffer_size,nbytes,offset);
return(std::string(buffer));
}
over pushing it on the stack or dynamically allocating it