The standard does not define or use the term "wild". I'd be careful "correcting" other people's opinions about what it means, and I'd especially avoid quoting random non-normative internet junk to support my position.

To me, it would mean a pointer that neither refers to a legitimate object, nor is NULL. Possible sources of these types of pointer values might include uninitialized pointer objects, objects that have ceased to exist, computed pointer values, improperly aligned pointer values, accidental corruption of the pointer itself, or what it pointed to, etc.

int main(void)
{

   int *p;  // uninitialized and non-static;  value undefined
   { 
      int i1; 
      p = &i1;  // valid 
   }            // i1 no longer exists;  p now invalid    

   p = (int*)0xABCDEF01;  // very likely not the address of a real object

   { 
      int i2;  
      p = (int*)(((char*)&i2) + 1);  // p very likely to not be aligned for int access
   }

   {
      char *oops = (char*)&p;  
      oops[0] = 'f';  oops[1] = 35;  // p was clobbered
   }
}  

and so on, and so forth. There are all kinds of ways to get an invalid pointer value in C. My favourite has got to be the guy who tried to "save" his objects by writing their addresses to a file. Strangely, when he read back those pointer values during a different run of the program, they didn't point to his objects any more. Fancy, that.

But that's just what wild means to me. Since it's not a normative term, it means whatever the person who spoke or wrote it meant it to mean. Ask him or her.

Answer from janks on Stack Overflow
Top answer
1 of 11
54

The standard does not define or use the term "wild". I'd be careful "correcting" other people's opinions about what it means, and I'd especially avoid quoting random non-normative internet junk to support my position.

To me, it would mean a pointer that neither refers to a legitimate object, nor is NULL. Possible sources of these types of pointer values might include uninitialized pointer objects, objects that have ceased to exist, computed pointer values, improperly aligned pointer values, accidental corruption of the pointer itself, or what it pointed to, etc.

int main(void)
{

   int *p;  // uninitialized and non-static;  value undefined
   { 
      int i1; 
      p = &i1;  // valid 
   }            // i1 no longer exists;  p now invalid    

   p = (int*)0xABCDEF01;  // very likely not the address of a real object

   { 
      int i2;  
      p = (int*)(((char*)&i2) + 1);  // p very likely to not be aligned for int access
   }

   {
      char *oops = (char*)&p;  
      oops[0] = 'f';  oops[1] = 35;  // p was clobbered
   }
}  

and so on, and so forth. There are all kinds of ways to get an invalid pointer value in C. My favourite has got to be the guy who tried to "save" his objects by writing their addresses to a file. Strangely, when he read back those pointer values during a different run of the program, they didn't point to his objects any more. Fancy, that.

But that's just what wild means to me. Since it's not a normative term, it means whatever the person who spoke or wrote it meant it to mean. Ask him or her.

2 of 11
13

A wild pointer in C is a pointer that has not been initialised prior to its first use. From Wikipedia:

Wild pointers are created by omitting necessary initialization prior to first use. Thus, strictly speaking, every pointer in programming languages which do not enforce initialization begins as a wild pointer.

This most often occurs due to jumping over the initialization, not by omitting it. Most compilers are able to warn about this.

eg

int f(int i)
{
    char* dp;    //dp is a wild pointer
    ...
}
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ dangling-void-null-wild-pointers
Dangling, Void , Null and Wild Pointers in C - GeeksforGeeks
January 10, 2025 - A pointer that has not been initialized to anything (not even NULL) is known as a wild pointer.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ what-are-wild-pointers-in-c-cplusplus
What are Wild Pointers in C/C++?
In C/C++, a wild pointer is a type of pointer that has not been initialized to a valid memory address. It points to memory that has been deallocated and is called a dangling pointer. The pointer behaves like a wild pointer when it is declared but not
๐ŸŒ
Scaler
scaler.com โ€บ topics โ€บ what-is-wild-pointer-in-c
What is Wild Pointer in C? - Scaler Topics
October 18, 2022 - We initialize the pointer variable ... meaningful value ยท The concept of wild pointers is they are almost the same as a normal pointer variable, the only difference is, that they are an uninitialized pointer variable, meaning they are not initialized at the time of their ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ dsa โ€บ what-are-wild-pointers-how-can-we-avoid
What are Wild Pointers? How can we avoid? - GeeksforGeeks
October 30, 2023 - // C program that demonstrated wild pointers int main() { /* wild pointer */ int* p; /* Some unknown memory location is being corrupted. This should never be done.
๐ŸŒ
Quora
quora.com โ€บ What-is-wild-pointer-in-c
What is wild pointer in c? - Quora
Answer (1 of 5): The uninitialized pointer are called as wild pointer. 1. Wild pointer pointing to some valid garbage address that should not be accessed.If we are trying to access it then there is a chance if system crash.
๐ŸŒ
Sankalandtech
sankalandtech.com โ€บ Tutorials โ€บ C โ€บ wild-pointer-c.html
Wild Pointers in C programming.
In C programming, a wild pointer refers to a pointer that has not been initialized or that points to an invalid memory location. When a pointer is considered wild, it means that its value is unpredictable and can lead to unexpected behavior when dereferenced.
Find elsewhere
๐ŸŒ
Aticleworld
aticleworld.com โ€บ home โ€บ dangling, void , null and wild pointer in c
Dangling, Void , Null and Wild Pointer in C - Aticleworld
May 25, 2021 - Uninitialized pointerโ€™s behavior is totally undefined because it may point to some arbitrary location that can be the cause of the program crash, thatโ€™s is the reason it is called a wild pointer. 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.
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Dangling_pointer
Dangling pointer - Wikipedia
October 26, 2025 - Dangling pointers and wild pointers in computer programming are pointers that do not point to a valid object of the appropriate type. These are special cases of memory safety violations.
๐ŸŒ
Reddit
reddit.com โ€บ r/c_programming โ€บ wild pointer
r/C_Programming on Reddit: wild pointer
July 17, 2024 -
{
   char *dp = NULL;
   
/* ... */
   {
       char c;
       dp = &c;
   } 
     
/* c falls out of scope */
     
/* dp is now a dangling pointer */
}

In many languages (e.g., the C programming language) deleting an object from memory explicitly or by destroying the stack frame on return does not alter associated pointers. The pointer still points to the same location in memory even though that location may now be used for other purposes.
wikipedia

so what is the problem if this address allocated with the same or different data type again

Q :

is that the same thing

#include <iostream>
int main(){
    int x=4;
    int *i=&x;
    char *c=(char*)&x;
    bool *b=(bool*)&x;
    } 
๐ŸŒ
PrepBytes
prepbytes.com โ€บ home โ€บ c programming โ€บ wild pointers in c
Wild Pointers in C
March 30, 2023 - In C programming language, a wild pointer is an uninitialized pointer that contains a random memory address that may point to a non-existent or invalid memory location. Therefore, it is important for C programmers to always initialize pointers ...
๐ŸŒ
CodeWithHarry
codewithharry.com โ€บ tutorial โ€บ c-wild-pointer
Wild Pointer | C Tutorial | CodeWithHarry
Here, a pointer named ptr is created but was not given any value. This makes the pointer ptr a wild pointer. Declaring a pointer and not initializing it has its own disadvantages. One such disadvantage is that it will store any garbage value in it. A random location in memory will be held in it arbitrarily.
๐ŸŒ
Quora
quora.com โ€บ What-is-a-wild-pointer-in-the-C-language
What is a wild pointer in the C language? - Quora
Answer (1 of 2): In the C programming language, a "wild pointer" is a pointer that holds an invalid memory address, i.e., a memory address that does not point to a valid object or variable.
๐ŸŒ
Fresh2Refresh
fresh2refresh.com โ€บ home โ€บ c programming tutorial โ€บ c interview questions โ€บ what is wild pointer in c?
What is wild pointer in C? | C Interview Questions | Fresh2Refresh.com
July 5, 2018 - What is wild pointer in C? - Uninitialized pointers are called as wild pointers in C which points to arbitrary (random) memory location.
๐ŸŒ
YouTube
youtube.com โ€บ watch
C_83 What is Wild Pointer in C | C Language Tutorials - YouTube
C complete playlist: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_SUse my code jkl10 to get 10% discountCareer as a Developer: http...
Published ย  August 28, 2021
Views ย  70K
๐ŸŒ
YouTube
youtube.com โ€บ neso academy
Understanding the Wild Pointers - YouTube
Data Structures: Understanding the Wild PointersTopics discussed:1) What is a Wild Pointer?2) An example Wild Pointer.3) How to avoid the Wild Pointers?C Pro...
Published ย  May 12, 2020