answersLogoWhite

0

Perhaps an example will help.

extern int value; /* declaration */

int value; /* definition */

int value= 20; /* definition with initialization */

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is Variable declaration and variable initialization?

...are important things in programming. Example: extern int variable; /* declaration */ int variable= 8; /* definition with initialization */


When variable in c gets memory After declaration or initialization?

Definition. Example: extern int x1; /* declaration */ int x2; /* definition */ int x3= 2; /* definition with initialization */


What is the difference between declaring variable and initializing variables?

Actually, there is a third step, call definition. Declaration is a statement to the compiler of what type an identifier is, definition is the allocation of memory for that identifier, and initialization is the assignment of an initial value to that identifier. Usually, declaration and definition are done together, but you can also add initialization in that step if desired. int a; /* declaration and definition */ a = 1; /* initialization */ int a = 1; /* declaration, definition, and initialization */ For the case of seperate declaration and definition, consider the struct... struct _mystruct { int a; }; /*declaration */ struct _mystruct mystruct; /* definition */ struct _mystruct { int a; } mystruct; /*declaration and definition */ Note: To be more precise: struct _mystruct; /* struct declaration */ struct _mystruct { int a; }; /* struct definition */ typedef struct _mystruct MYTYPE; /* type definition */ extern struct _mystruct mystructvar; /* variable declaration */ struct _mystruct mystructvar; /* variable definition */ struct _mystruct mystructvar = {7} ; /* variable definition with initialization */ struct _mystruct { int a; } mystruct; /* struct definition and variable definition */ extern struct _mystruct { int a; } mystruct; /* struct definition and variable declaration */


Whats the difference between Virginia Declaration of Rights and Declaration of Rights?

There is a difference


Assigning a value to a variable in a declaration statement is called?

Answer is; initialization *** Edit*** Initialization is correct. Page 59 Programming Logic and Design by Tony Gladdis


What is the difference between instantiation and initialization in C plus plus?

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10


What is the difference between the declaration of independence and the articles of confederation?

idek


What is the difference between initialisation and definition in C programming?

Variable-declaration is: extern int x; extern double y; extern char a; Variable-definition is: int x; static double y; auto char a; Variable-definition with initialization is: int x = 1; static double y= 2.3; auto char a = 'w';


What is the difference between declaration and definition?

definition: the meaning or description of person/place/thing declaration: taking a stand


What is the difference between declaration and a definition in c plus plus?

A declaration is an incomplete type whereas a definition is a complete type.


What is the difference between the declaration and the Treaty of Paris?

The Declaration of Independence showed what the patriots wanted, and the Treaty of Paris made the dream real.


What is different between the Declaration of Independence and the declaration of sentiments?

The one main difference between the Declaration of Independence and the Declaration of Sentiments is that the DoI was written by Thomas Jefferson, a man, in 1776; while the DoS was written by Elizabeth Cady Standon, a woman, in 1848.