I was getting realloc(): invalid next size for a program. So I just coded this to understand what\'s happening.
realloc(): invalid next size
#include #include &l
sizeof(inp) gives you the size of pointer (8 bytes, 64-bits), not the storage under that pointer.
sizeof(inp)