answersLogoWhite

0

What is a static data linkage?

Updated: 8/17/2019
User Avatar

Wiki User

13y ago

Best Answer

Static data members of a class in namespace scope have external linkage. Static data members follow the usual class access rules, except that they can be initialized in file scope. Static data members and their initializers can access other static private and protected members of their class. The initializer for a static data member is in the scope of the class declaring the member.

A static data member can be of any type except for void or void qualified with const or volatile.

The declaration of a static data member in the member list of a class is not a definition. The definition of a static data member is equivalent to an external variable definition. You must define the static member outside of the class declaration in namespace scope.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a static data linkage?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between static data member and ordinary data member?

Static data is data that does not change from program load to program exit. Static data member do not apply for c. In c++, a static data member is one that is common for all instances of that class.


What is a dynamic data linkage?

A Dynamic Data Linkage means that if the same data is used in different parts of the package and you change into one part the change will be carried by computer to all programs using the data.


Where the static variables are stored?

initialize static variables are stored in data segment where uninitialized static variables are stored in BSS(block storing for Symbol) it also a part of data segment exp static int i=10;//stored in data segment static int i;//stored in BSS (uninitialized data segment) Thanks NAvin


How is memory allocated to the private-data member function when an object is not created during the calling process?

A class can have both static and non-static data. Static data is local to the class while non-static data is local to each object of the class. It makes no difference whether static data is global, local to a file, local to a function or local to a class (whether public, protected or private), all static data is allocated within the program's data segment along with all constants. As such they are allocated at compile time.


When Static function can work with static data member only?

Always.


What is static and dynamic data structure?

In dyanamic data structure emory allocation for the data structure takes place at run time,only requered amount of memory is allocated(eg.linked lists).In static data structure memory is reseved at the time of compilation(eg.arrays).


Why in line functions should not access static data?

It may access static data, but you have to know what 'static data' means: data, which is local to the current module (not shared with other modules), so if you use the function both from module 'A' and from module 'B', they will use different variables (with the same name).


What is the pupouse of static function?

A static function, not part of a class, is visible only to other code within the same compilation unit, i.e. the same source file. A static function, part of a class, can only operate on static class data, which is per class data as opposed to per instance data.


What happen when static data field is initialised in a non static constructor?

It got initialized as you instructed.


What memory that requires refreshing of data is?

static


When memory allocate to Static data in c?

Compilation time.


What is used to make a linkage map for a group?

The data collected when all the members of a population have been genotyped (scored) with a set of molecular markers can be used to make a linkage map.