C ++ STL cout源代码 [英] c++ STL cout source code

查看:267
本文介绍了C ++ STL cout源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看STL std :: cout 函数的源代码。我查看了iostream,但只看到了外部提示。因此,我想它是在库中定义的。

I want to see source code of STL std::cout function. I looked at iostream, but I've seen only "extern cout". So, I guess that it's defined somewhere in the library.

我从官方网站

我将其提取并做了:

sh@sh-R528-R728:~/desktop/stl$ grep -F * | grep "cout"

但我什么也没得到。

我在做什么错?源代码在哪里?

What am I doing wrong? Where is the source code?

推荐答案

cout 不属于STL,因此您不会在STL源中找到 cout 的源。

cout is not part of the STL, so you won't find the source for cout in the STL source.

您可能想看看C ++标准库的源代码,该库基于STL,但还包含iostream。这取决于您使用的平台。

You probably want to look for the source for your C++ standard library, which was based on the STL, but also contains iostreams. Where that is depends on what platform you're using.

这篇关于C ++ STL cout源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆