how shd i do only declaration then !!
extern int a; ???
is this right !!
Yes. extern keyword tells to compiler that variable 'a' is defined somewhere else, i.e. with 'extern' we only do declaration of variables. And Definition = Declaration + Memory allocation + Initialization (sometimes) ,- such as int a ;
"Object --- a region of data storage in the execution environment, the contents of which can represent values. Except for bit-fields, objects are composed of contiguous sequences of one or more bytes, the number, order, and encoding of which are either explicitly specified or implementation-defined."
From this I conclude that a pointer variable is an 'object'.
"Definition --- A declaration of a variable or function which allocates and optionally initializes (in the case of a variable) or provides the function body (in the case of a function). A definition in this sense is the opposite of declaration, sense 2. See question 1.7. 2. A declaration of a structure, union, or enumeration type which describes the type (and usually assigns a tag) without necessarily defining any variables of that type. 3. A preprocessor #define directive."
Applied to pointer variables: since storage for holding a memory address is allocated and since initialization of the variable is optional, I would conclude that int *p; is a definition.
Hm... it depends How we will define "definition". If it is defined like you said - then yes, you are right, p is defined and object to which p points to is undefined. But in general case it is unreasonable to argue on definitions cause same thing can be defined in many ways. And there are no clear way to distinguish which definition is better than the other.