[Unnecessary]
edit: Nevermind, .
|
The problem is that in C++ a vector is a struct which contains a pointer to dynamically allocated data. You would have to do some non-portable hack to point the pointer to your mmap data. Any time you make a change to the data it may cause it to be moved or reallocated, which would break your mmap.
|
you can of course copy the content into a vector
but I am not sure if (and why) you want to do this do you just want to read or also write to the file? you can also have a look at boost iostream, it deals also with mmaped files http://www.boost.org/doc/libs/1_55_0...pped_file.html |
Well, a vector or a string. I'm trying to do manipulation and using char *'s is giving me problems. I'm hoping that moving to another format might clean things up a bit.
|
what's the problem with char* ?
what do you think would be different with a vector? what with a string,(beside that std::string s("дце") is possibe utf8 in your environment) automatically growth of the size? beside this there is basically no difference to a 'fix size array' it would possible be more useful to describe your problem |
@endhx
instead of changing the subject and removing the content of you OP just mark the thread as solved I think this is better than changing the history (and helps to get not ignored in future) |
All times are GMT -5. The time now is 05:42 PM. |