Skip to content

Comment on C++ Software Security Sins: Basic Issuesparent

Comments

what do you use? std::array? alloca? std::string? heap allocation? a lot of std library functions need char *

std::array<char, 26> foo{}; foo.data(); // <- returns a pointer to foo's data inheriting it's type. so we get *char here

std::string would work in a similar way, except it would be `const`

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.