C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 8)
8.
Is the following statement a declaration or definition?
extern int i;
Declaration
Definition
Function
Error
Answer: Option
Explanation:

Declaring is the way a programmer tells the compiler to expect a particular type, be it a variable, class/struct/union type, a function type (prototype) or a particular object instance. (ie. extern int i)

Declaration never reserves any space for the variable or instance in the program's memory; it simply a "hint" to the compiler that a use of the variable or instance is expected in the program. This hinting is technically called "forward reference".

Discussion:
38 comments Page 4 of 4.

Princydhas said:   1 decade ago
int i=1;

This statement is definition or declaration ?

Sureshkumar said:   1 decade ago
Where should I use extern? can you tell little deeper.

Rahul said:   2 decades ago
Why we use extern keyword?

Antony said:   2 decades ago
What actually here mean by "extern" ?

Pranali said:   1 decade ago
For the word INDIRA how it can be char[7]?

Pri said:   1 decade ago
It means some rules and regulations.

Hema said:   7 years ago
Give me clear information of extern.
(1)

Devendra said:   1 decade ago
What is meaning of prototype?


Post your comments here:

Your comments will be displayed after verification.