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
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 ?
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
64.3k questions
77.9k answers
244k comments
80.0k users