Size of dynamic array in C doesn't change

前端 未结 4 1351
我在风中等你
我在风中等你 2021-01-29 02:39

I was getting realloc(): invalid next size for a program. So I just coded this to understand what\'s happening.

#include 
#include &l         


        
4条回答
  •  半阙折子戏
    2021-01-29 03:12

    sizeof(inp) gives you the size of pointer (8 bytes, 64-bits), not the storage under that pointer.

提交回复
热议问题