gpt4 book ai didi

c++ - rdbuf()->str() 在哪里?

转载 作者:行者123 更新时间:2023-11-27 23:45:25 24 4
gpt4 key购买 nike

我正在尝试了解 IO 流的结构。
cppreference std::basic_stringstream::str 开始:

Manages the contents of the underlying string object.

1) Returns a copy of the underlying string as if by calling rdbuf()->str().

rdbuf() 返回一个 std::basic_streambuf 对象,但我在 https://en.cppreference.com/w/cpp/io/basic_streambuf 中找不到 str() 成员函数。

最佳答案

仔细再看一遍。 std::basic_stringstream::rdbuf()实际上返回一个指向 std::basic_stringbuf 的指针, 不是指向 std::basic_streambuf 的指针正如你所说。

str()std:::basic_stringbuf 的一种方法.

关于c++ - rdbuf()->str() 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51094368/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com