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
What is c variable?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Explain how can you tell whether two strings are the same?
How is = symbol different from == symbol in c programming?
Describe the steps to insert data into a singly linked list.
What is the purpose of void pointer?
What is the difference between printf and scanf in c?
What is formal argument?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
How would you obtain the current time and difference between two times?
Where are local variables stored in c?
Can a pointer point to null?
What is storage class?
Differentiate between static and dynamic modeling.