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
Why do some versions of toupper act strangely if given an upper-case letter?
What is main () in c?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
what is the diffrenet bettwen HTTP and internet protocol
Which is an example of a structural homology?
What is the most efficient way to count the number of bits which are set in an integer?
Differentiate call by value and call by reference?
What is null pointer constant?
Is main is a keyword in c?
Write a program to find factorial of a number using recursive function.
Write a program to reverse a linked list in c.
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Why header files are used?
How can I manipulate individual bits?
What is the difference between constant pointer and constant variable?