gpt4 book ai didi

c++ - 我需要在 ostream 的头文件中包含什么

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:15:18 26 4
gpt4 key购买 nike

当我尝试编译我的程序时,编译器在我#included 的 .h 文件中提示这一行。

ostream & Print (ostream & stream);

如何解决这个问题?

最佳答案

如果你#include <ostream> , ostream将在 std 中定义命名空间:

#include <ostream>

// ...

std::ostream & Print (std::ostream & stream);

关于c++ - 我需要在 ostream 的头文件中包含什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2887507/

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