troubleshooting Question

sizeof(std::string) always 32.

Avatar of Unimatrix_001
Unimatrix_001Flag for United Kingdom of Great Britain and Northern Ireland asked on
C++
9 Comments4 Solutions676 ViewsLast Modified:
Hello,

Irrelevant of what std::string is set to, I permanently get 32 as the size, why is this and why does the size and length methods both ignore the null byte, giving the same result even if there isn't one? Similarly, do I take it std::string manages the null byte itself as I never appear to have any problems with it not being null terminated?

Thanks,
Uni
ASKER CERTIFIED SOLUTION
evilrix
Senior Software Engineer (Avast)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros