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.
I downloaded source code from official site
I extracted it and did:
sh@sh-R528-R728:~/desktop/stl$ grep -F * | grep "cout"
but I got nothing.
What am I doing wrong? Where is the source code?
coutis not part of the STL, so you won’t find the source forcoutin the STL source.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.