what does it mean to declare a member variable as a static, C/C++ Programming

Assignment Help:

b) The static keyword let a variable to maintain its value among distinct function calls.

If the value of a static variable alters while the variable has been accessed, variable keeps the new value. If the identical variable gets accessed again, it would be storing its most recent value. It is possible because, while the static variable is declared, the compiler employee a separate memory area to hold it. By doing this, while the value of the static variable gets altered, it is updated in the memory it is occupying. And since this memory is separate, the compiler can check its values even whilst its function exits.

 


Related Discussions:- what does it mean to declare a member variable as a static

Main-elipse -vector-arrays in cpp , Unlike C++, other programming languages...

Unlike C++, other programming languages have associative arrays that allow array indices to be strings instead of just integers. You are to create a template class, SVector, that i

Console atm machine coding, construct a console programme for a bank ATM m...

construct a console programme for a bank ATM machine.

C program for pattern star, 1 PETTERN1 (Pettern1.c)   main() { ...

1 PETTERN1 (Pettern1.c)   main() {           int i,j,k=1,a;           clrscr();           for(i=1;i           {                    if(i>=3)

Bus Connection, how to explain working of bus connection

how to explain working of bus connection

#titlbinary searching.., Ask question #Minimum 100 words awhat is the pre c...

Ask question #Minimum 100 words awhat is the pre condition for binary searching ccepted#

How virtual functions can be implemented in c++?, Normal 0 fals...

Normal 0 false false false EN-US X-NONE X-NONE

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd