How cout is for static duration?

104 views Asked by At

cout - C++ Reference

The object is declared in header with external linkage and static duration: it lasts the entire duration of the program.

I am using Visual Studio. If I go to its declaration it is like,

__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2 ostream cout, *_Ptr_cout;

I understand its external linkage, but how it is static duration?

1

There are 1 answers

0
Anton Savin On BEST ANSWER

[basic.stc.static]/1:

All variables which do not have dynamic storage duration, do not have thread storage duration, and are not local have static storage duration. The storage for these entities shall last for the duration of the program