what would be the output of the following program?
main()
{
int k = 123;
char *ptr;
ptr = &k;
printf("%d",*ptr);
}
Answer Posted / srsabariselvan
The program results in compilation error.
NOTE: a pointer can stores the address of same data type.
it can't store the address of another data type.
i.e.,
character pointer can stores the address of character data.
it can't store the address of integer data.
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Explain how do you view the path?
What is difference between constant pointer and constant variable?
What is the difference between typedef and #define?
What does c in a circle mean?
Tell us two differences between new () and malloc ()?
Explain what is wrong with this program statement?
Why main is not a keyword in c?
What is main () in c?
Why #include is used in c language?
What is define c?
What is the importance of c in your views?
Can we access the array using a pointer in c language?
given post order,in order construct the corresponding binary tree
Is null always defined as 0(zero)?
What are the different types of constants?