It's very bothersome for me to write calloc(1, sizeof(MyStruct))
all the time. I don't want to use an idea like wrapping this method and etc. I mean I want to know what two parameters gives me? If it gives something, why doesn't malloc
have two parameters too?
By the way, I searched for an answer to this question but I didn't find a really good answer. Those answers was that calloc
can allocate larger blocks than malloc
can and etc.
I saw another answer that calloc
allocates an array. With malloc
I can multiply and I'll get an array and I can use it without 1,
at the start.