Y
Hacker News
new
|
ask
|
show
|
jobs
by
saagarjha
2912 days ago
I was referring to std::string, which is what you should be using if you're handling textual data natively.
2 comments
nwmcsween
2910 days ago
The implementation of std::string is 99.999% of the time struct { char *s; size_t len; }, which has nothing to do with an actual type.
link
gmueckl
2911 days ago
And it's even possible to use std::string as a buffer for binary data including NULs. I won't recommend it, but it works.
link
saagarjha
2911 days ago
I'd suggest using a std::vector of byte-sized integers for clarity, though there's nothing wrong from a standards point in using a std::string.
link