C Quiz – 109 | Question 4
Find out the correct statement for the following program.
* lPtr = NULL;
(gPtr == lPtr)
(A) It’ll always print Equal.
(B) It’ll always print Not Equal.
(C) Since gPtr isn’t initialized in the program, it’ll print sometimes Equal and at other times Not Equal.
Explanation: It should be noted that global variables such gPtr (which is a global pointer to int) are initialized to ZERO. That’s why gPtr (which is a global pointer and initialized implicitly) and lPtr (which a is local pointer and initialized explicitly) would have same value i.e. correct answer is a.
Quiz of this Question
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!