Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
Here after n=n+1 does realloc allocates size of n+1 only or n+n+1?
2 Answers
+ 1
thanks
0
n=n+1 will change n to n+1 only. So realloc will change the final size of a to n+1.
You may verify the same by printing :
sizeof(a)/sizeof(a[0]);