answersLogoWhite

0

There are three meanings to the static attribute in C++

First of all, static means that the variable has run-time persistance. It will retain its last value, i.e. until changed, until the program exits.

Second, if the variable is defined at file scope, i.e. outside of all blocks, then its scope or visibility willonly be within the file that it is contained within.

Last, if the variable is a static member of a class, then it has common value and storage amongst all instances of that class.

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin

Add your answer:

Earn +20 pts
Q: What is a static varialble in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp