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 is %d used in c?
Explain what is the heap?
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
What do you mean by c what are the main characteristics of c language?
Do variables need to be initialized?
Explain modulus operator.
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
How can you find out how much memory is available?
What will the preprocessor do for a program?
How is a macro different from a function?
Explain what are the different data types in c?
Why is c platform dependent?
What are the modifiers available in c programming language?
How can I run c program?
What language is lisp written in?