Personal Framework

The Partridge Family were neither partridges nor a family. Discuss.
superstar1998
Posts: 52
Joined: March 10th, 2015, 7:51 pm
Location: Romania
Contact:

Re: Personal Framework

Post by superstar1998 » June 7th, 2015, 10:04 am

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.
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”

– Martin Golding

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Personal Framework

Post by albinopapa » June 7th, 2015, 4:05 pm

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

Post Reply