Question:
How pointer variables are initialized ?
Answer:
int a; int *p; int p=&a; this is initialization n if its not initialized its called as dangling pointer Source: CoolInterview.com
Answered by: amrut malaji | Date: 5/28/2008
| Contact amrut malaji
pointer variable is initialized as datatype *variablename (declaration eg:int *ptr,x;
in this it is initialized as ptr=&x; Source: CoolInterview.com
Answered by: malathy.s | Date: 5/28/2008
| Contact malathy.s
main() { int *a;//declaration of pointer variable printf("%d",sizeof(a)); } Source: CoolInterview.com
Answered by: shoba | Date: 5/29/2008
| Contact shoba
Assigning the address of a variable to the the pinter variable is nothing but the initialization of pointer. eg. int x=10,*p = &x; or int x=10, *p; p = &x; Source: CoolInterview.com
Answered by: mahima | Date: 5/29/2008
| Contact mahima
int *p,a=1; p=&a; The pointer must have same data type as that of variable whose address is stored into it. Source: CoolInterview.com
Answered by: kanika | Date: 6/5/2008
| Contact kanika
int a; int *p; int p=&a; this is initialization n if its not initialized its called as dangling pointer.
Posted by: amrut malaji
Contact Author Contact Author pointer variable is initialized as datatype *variablename (declaration eg:int *ptr,x;
in this it is initialised as ptr=&x;
Posted by: malathy.s
Contact Author Contact Author main() { int *a;//declaration of pointer variable printf("%d",sizeof(a)); }
Posted by: shoba
Contact Author Contact Author Assigning the address of a variable to the the pinter variable is nothing but the initialization of pointer. eg. int x=10,*p = &x; or int x=10, *p; p = &x;
Posted by: mahima
Contact Author Contact Author int *p,a=1; p=&a; The pointer must have same data type as that of variable whose address is stored into it.
Posted by: kanika
Contact Author Contact Author Source: CoolInterview.com
Answered by: vishwanath soni | Date: 6/18/2008
| Contact vishwanath soni
main() { int *a;//declaration of pointer variable printf("%d",sizeof(a)); } Source: CoolInterview.com
Answered by: doom | Date: 6/24/2008
| Contact doom
pointer is a variable which holds address of another variable a is pointer a=&b here pointer holds the address of b declaration int *p; p=&a;initialization of pointer Source: CoolInterview.com
Answered by: praveen kumar | Date: 8/11/2008
| Contact praveen kumar
pointer is initialised in followint way int a; int *p; p= null; p=&a; Source: CoolInterview.com
Answered by: ganesh kathar | Date: 8/22/2008
| Contact ganesh kathar
pointer variable is initialized as datatype *variablename (declaration eg:int *ptr,x; Source: CoolInterview.com
Answered by: Renjitha Anoop | Date: 2/3/2009
| Contact Renjitha Anoop
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|