Is there a function to generate a random int number in C? Or will I have to use a third party library?
You can use the concept of a dangling pointer.
A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer.
It will show random values while printing.