How to get length of std::stringstream without copying September 2, 2023 by Tarik Assuming you’re talking about an ostringstream it looks like tellp might do what you want.