Assign Address to Pointer Variable in C
Assign Address to Pointer Variable :-
When we declare a pointer variable it contains garbage value, i.e. it may be pointing anywhere in the memory. So we should always assign an address before using it in the program.
Example :-
int * iptr,age=30;
float * fptr=1500.50;
iptr= &age;
fptr = *sal;
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment