×

Loading...

it's a C language concept than C++

guest (zack)
I think it will be narrower.
when a variable is defined outside any functioin, it is stored as static, no matter whether put "static" keyword before the variable.
If you put "static" before the variable, that means this variable can only be used within this .cpp file, cannot be used in any other .cpp file which even use "extern" keyword.

I guess the confusion is we usually use "static" within a function, in this case the "static" change the storage way of a variable from dynamic to static. this "static" is totally different concept as that "static" you mentioned.
(#13101@0)
2000-11-3 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: Jabber's Q(3)

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论