Y
Hacker News
new
|
ask
|
show
|
jobs
by
compiler-guy
1827 days ago
And only works if you don't rely on any third-party libraries that take normal C strings.
Which is to say, is unrealistic for many programs.
3 comments
pjmlp
1827 days ago
Depends on much they value security, even std::string has an extra null for
c_str()
calls.
link
habibur
1826 days ago
Send the pointer from the pair to 3rd party and not the pair itself. You lose the efficiency in 3rd party, but still retain your gain in your own code. Better than before.
link
tgv
1827 days ago
You can use a library that also adds a trailing \O. I used it to interface C++.
link