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

How do you redirect a standard stream?

618


Explain the use of 'auto' keyword

674


How many levels of indirection in pointers can you have in a single declaration?

589


What does the format %10.2 mean when included in a printf statement?

1079


What is bubble sort in c?

630






What is binary tree in c?

617


What is the difference between formatted&unformatted i/o functions?

610


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2389


What are the main characteristics of c language describe the structure of ac program?

604


How can I change the size of the dynamically allocated array?

625


explain what is fifo?

630


What is scanf_s in c?

629


what are the facialities provided by you after the selection of the student.

1650


Write a program to print factorial of given number without using recursion?

565


Is it better to use a macro or a function?

649