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
What's the right way to use errno?
Is c language still used?
What is the sizeof () operator?
What is a nested loop?
Explain why C language is procedural?
What is memory leak in c?
When is a null pointer used?
Differentiate between new and malloc(), delete and free() ?
What is the scope of static variable in c?
Why c is a mother language?
Explain two-dimensional array.
while initialization of array why we use a[][2] why not a[2][]...?
in iso what are the common technological language?
How can you tell whether two strings are the same?
What is the use of volatile?