Before you start to mark this question as duplicate I've already this but it doesn't answer my question.
stream objects like std::cout, std::cin are global instances of ostream & istream classes. But my question is when memory is allocated to these objects? When these objects are initialized? Is memory allocated at compile time or runtime or C++ runtime initialize these objects at runtime before calling main()?
Where std::cout & std::cin object resides: in the stack, heap or data segment?