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 / yogi

int *p=20;
This is like int *p;p=20;
printf("%d",p);It prints p properly as 20;
printf("%d",*p);It means deference the value at address 20,
which is invalid .

If we try to run,as address 20 is invalid and it tries to
fetch the value at address 20,signal 11 sent to that process
i.e it dumps core with segmentation fault

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages and disadvantages of c language?

562


how to find binary of number?

3439


Why is C language being considered a middle level language?

657


Why we use break in c?

552


Differentiate between Macro and ordinary definition.

731






Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2122


What is the difference between exit() and _exit() function?

606


Is calloc better than malloc?

578


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3691


What do you mean by recursion in c?

627


what is a function method?give example?

1914


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

630


List some of the dynamic data structures in C?

790


How do I swap bytes?

631


What are linker error?

614