int *p=20;
if u print like dis printf("%d",p);
o\p:- 20; how is it possible?
plz give me the explanation.

Answer Posted / vignesh1988i

ya,, i think..
first we have declared an pointer variable *p and
assigned a value 20.... but we know that pointers are those
which can hold only the address of another variable..... so
surely in the memory P it wont have 20... so 20 will be
stored in some other unbknown variable in the memory which
wont be visible to user in thesr cases...... that unknown
memory address will be getting stored in this pointer
variable.... so when we give only p or *p it will print 20
and not the address of the unknown location containing
20........... because it will be directly accessible

Is This Answer Correct ?    7 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

867


What is strcpy() function?

861


What is the difference between class and object in c?

813


Explain how can you avoid including a header more than once?

819


Explain modulus operator.

801


Tell me when would you use a pointer to a function?

810


What is malloc calloc and realloc in c?

912


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1053


Tell me is null always defined as 0(zero)?

830


c program for searching a student details among 10 student details

1870


What is scope rule of function in c?

773


In a switch statement, what will happen if a break statement is omitted?

815


What are the 4 types of unions?

785


Why c is a mother language?

738


What is a constant?

814