C Programming - Pointers - Discussion

Discussion Forum : Pointers - Find Output of Program (Q.No. 13)
13.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int arr[3] = {2, 3, 4};
    char *p;
    p = arr;
    p = (char*)((int*)(p));
    printf("%d, ", *p);
    p = (int*)(p+1);
    printf("%d", *p);
    return 0;
}
2, 3
2, 0
2, Garbage value
0, 0
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
87 comments Page 9 of 9.

Madhuri said:   1 decade ago
Good explanation viraj.

Pradeep said:   9 years ago
Nice explanation @Puru.

Nitin said:   1 decade ago
Well explained Viraj.

Sanjoy said:   1 decade ago
What is type casted?

Muhammad Imran said:   9 years ago
Type casting means?

Abdul said:   4 years ago
Well done @Mayur.

Adi said:   1 decade ago
Well done viraj.


Post your comments here:

Your comments will be displayed after verification.