What is the default value of a pointer that has NOT been initialized in C?

2025

What is the default value of a pointer that has NOT been initialized in C?

  1. A.

    NULL

  2. B.

    -1

  3. C.

    0

  4. D.

    Undefined (Garbage Value)

Attempted by 79 students.

Show answer & explanation

Correct answer: D

In C, an uninitialized pointer contains a garbage value. This is because the memory location holds whatever data was previously stored there, making it unpredictable and dangerous to use without explicit initialization.

Explore the full course: Rssb Basic Computer Instructor