in Programming in C edited by
1,077 views
2 votes
2 votes

Q. What is the output of following program?

int main(){
    register int Data =10;
    int *piSumData = NULL;
    piSumData = &Data;
    *piSumData = 5; 
    printf("%d",*piSumData);
}

1. Run time error
2. garbage value
3. 10
4. 5

in Programming in C edited by
1.1k views

4 Comments

But I executed this code on Linux and it is giving compile time error. @Dharmendra Verma
0
0

I executed the above code snippet on geeksforgeeks.org and I got compile error, but not runtime error. Can anyone please explain what the correct answer should be ?

0
0

I guess the following 2 links explain the required concept for this question...

https://aticleworld.com/storage-class/

https://www.quora.com/How-can-you-access-a-memory-location-using-C

0
0

Please log in or register to answer this question.

Related questions