Thanks guys, I actually found an easier way to do it, hand't thought it could. It's something like this:
std::wstring(buffer, buffer + sizeof(buffer) - 1);
And buffer is a pointer to a string.
Personal Framework
-
- Posts: 52
- Joined: March 10th, 2015, 7:51 pm
- Location: Romania
- Contact:
Re: Personal Framework
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”
– Martin Golding
– Martin Golding
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Personal Framework
word of caution with sizeof operator. Will work sometimes on C-Style arrays, but it's more of a sizeof data type, in other words, it wouldn't work on a pointer, it would just return the size of the pointer and not the array.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com