adspace


How is static data member similar to a global variable?

Answer Posted / Jeetendra Kumar Pandey

Static data members are similar to global variables because they have a lifetime for as long as the program runs, and they can be accessed from anywhere within their scope. However, static data members belong to a specific class, while global variables do not.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What character terminates all character array strings a) b) . c) END

1403


What is the latest version on c++?

1217


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1172


daily Routine of father

1489


Can union be self referenced?

1275