Skip to main content
8 votes
Accepted

How to calculate len size from unsigned char* in C++20?

Yes, unsigned char, signed char, and char are all exactly one byte large, so s.size() gets you the size in bytes of your string. The subsequent two lines are unnecessary, and it's also worth noting ...
Jan Schultke's user avatar
  • 45.1k

Only top scored, non community-wiki answers of a minimum length are eligible