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
55

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
July 11, 2026 - A wild pointer is a pointer that has been declared but not initialized. Since it contains a random (garbage) memory address, using it can lead to undefined behavior.
Discussions

wild pointer
Memory is not allocated with a specific data type, memory allocation is only a matter of size to be reserved for a particular purpose. So the only difference between your two codes from a memory point of view is the life time of the data stored. But if we're talking about your pointers, In the first case your pointer point to an unpredictable data (it may be reallocated a any time) and in the second case you access the same zone of memory with three different ways. More on reddit.com
๐ŸŒ r/C_Programming
43
3
October 1, 2024
How do you prevent dangling pointers in your code?
good practices and valgrind More on reddit.com
๐ŸŒ r/C_Programming
55
24
March 4, 2024
Is it possible to get more information about the location of an error thrown by the address sanitizer?
https://stackoverflow.com/questions/73177115/can-asan-issue-trap-upon-violation-like-ubsan-does For historical reasons Asan simply exits the application on error but you can ask it to abort (which will be intercepted by gdb) by setting environment variable: export ASAN_OPTIONS=abort_on_error=1 Or you could simply set a breakpoint at __asan_report_error in gdb. More on reddit.com
๐ŸŒ r/C_Programming
10
1
September 11, 2023
Podziemski with a wild leaning 3-pointer that banks in at ...
Sorry, something went wrong when loading this video. View in app ยท They welcomed Steph Curry with Tech Curry~! More on reddit.com
๐ŸŒ r/warriors
๐ŸŒ
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. 2. When we do initialization of that pointer then it will be a normal po...
๐ŸŒ
DEV Community
dev.to โ€บ godinhojoao โ€บ wild-and-dangling-pointers-in-c-3kj5
Wild and Dangling Pointers in C - DEV Community
October 11, 2025 - Wild Pointer: A pointer that has not been initialized, pointing to random memory.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ what-are-wild-pointers-in-c-cplusplus
What are Wild Pointers in C/C++?
March 15, 2026 - In C, a wild pointer is a pointer that has not been initialized to a valid memory address. When a pointer is declared but not assigned a value, it contains garbage data and points to an unknown memory location, making it unpredictable and dangerous
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ what is wild pointer in c?
What is Wild Pointer in C? - Scaler Topics
September 4, 2023 - 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 ...
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Dangling_pointer
Dangling pointer - Wikipedia
August 8, 2026 - In object-oriented languages with ... do not have any incoming pointers; this is ensured either by tracing or reference counting. However, a finalizer may create new references to an object, requiring object resurrection to prevent a dangling reference. Wild pointers, also called ...
Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/c_programming โ€บ wild pointer
r/C_Programming on Reddit: wild pointer
October 1, 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;
    } 
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ dsa โ€บ what-are-wild-pointers-how-can-we-avoid
What are Wild Pointers? How can we avoid? - GeeksforGeeks
January 15, 2026 - ... int main() { int* p = (int*)malloc(sizeof(int)); // This is fine (assuming malloc doesn't return // NULL) *p = 12; } Note: int *ptr is wild because it points to some garbage memory by default, but int *ptr = NULL is not wild because it clearly ...
๐ŸŒ
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
๐ŸŒ
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. Attempting to access or dereference a wild pointer can cause unexpected behavior, such as a segmentation fa...
๐ŸŒ
Quora
quora.com โ€บ What-is-the-difference-between-a-wild-and-a-dangling-pointer-in-C
What is the difference between a wild and a dangling pointer in C? - Quora
Answer (1 of 5): A pointer pointing to a memory location that has been deleted (or freed) is called DANGLING POINTER. [code ] #include [/code] [code ]#include [/code] [code ]int[/code] [code ]main()[/code] [code ]{[/code] [code ] int[/code] [code ]*ptr = (int[/code] [code ...
๐ŸŒ
YouTube
youtube.com โ€บ learn coding
wild pointer in c with example | What is Wild Pointer? | Learn Coding - YouTube
C language Pointer Tutorial...! ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡https://www.youtube.com/playlist?list=PLqleLpAMfxGC_39XKLj10U_k_n2_V2VEmPlease Subscribe our Channel...!Learn Coding ๐Ÿ™...
Published: September 12, 2020
Views: 43K
๐ŸŒ
YouTube
youtube.com โ€บ watch
What is wild Pointer in C. #pointer #cprogramming #gcc
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
๐ŸŒ
Aimtocode
aimtocode.com โ€บ wild-pointer-in-c.php
What are Wild Pointers In C With Examples - Aimtocode
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.
๐ŸŒ
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 ...
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ dangling pointer in c language explained (with code examples)
Dangling Pointer In C Language Explained (With Code Examples)
March 12, 2024 - It is represented as NULL or null ptr (in C++11 and later). Wild Pointer: A wild pointer in C is a pointer that has not been properly initialized or points to an arbitrary memory location.