What does extern mean in a function declaration?


Interview questions

What does extern mean in a function declaration?

<<Previous  Next>>

C++  - What does extern mean in a function declaration? - April 16, 2009 at 13:20 PM by Vidya Sagar

What does extern mean in a function declaration?  

An extern function or a member can be accessed outside the scope of the .cpp file in which it was defined.

A variable, function or declaration that is defined with extern, allows to make the usage f variable, function by the remaining part of the current source file. The declaration does not replace the definition. The declaration of function or a variable is just to describe their use external to the current file.

In case one identifier is declared with file scope, and an identifier that is declared external with the same name within a block refers the same object. In case no other identifier exists at file scope then the identifier will be linked to the external file.

Also read

What are pure virtual functions?

Pure virtual functions are also called ‘do nothing functions’.
e.g. virtual void abc() = 0;
When a pure virtual fnction is declared in the base class, the compiler necessitates the derived..............

Explain the difference between struct and class in terms of Access Modifier.

All members of a class are private by default, whereas fields of a struct are public. Default access of a base class is private for classes and public for structures...............

What is private, public and protected Inheritance?

Private Inheritance
The Public and protected members of Base class become private members of the derived class................

<<Previous  Next>> 

Write your comment - Share Knowledge and Experience


Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us