Reputation: 30615
I have the following code which loads a file into a boost mapped_region:
file_mapping fm(FilePath, read_only);
mapped_region region(fm, read_only);
char * const data = static_cast<char *>(region.get_address());
char*
pointer, but rather a static char array char c[x]
?Upvotes: 0
Views: 714
Reputation: 51253
file_mapping fm(FilePath, read_only);
mapped_region region(fm, read_only);
char * const data = reinterpret_cast<char*>(region.get_address());
// Iterate through the data obtained, character (c) by character.
for(std::size_t n = 0; n < region.get_size(); ++n)
{
char c = data[n];
}
Upvotes: 1