Wild Pointers In C with examples

aimtocode

Wild Pointer Definition

A pointer that is not initialized prior to its first use is known as the wild pointer.

Uninitialized pointers behavior is totally undefined because it may point some arbitrary location that can be the cause of the program crash. Therefore, that’s is the reason it is known as a wild pointer in C.

In other words, we can say every pointer in programming languages that are not initialized either by the compiler or programmer begins as a wild pointer.

Example :



Example 2:

C program to call a function using function pointer



Output:

  Addition is: 10
aimtocode