I\'m not sure exactly what I need to use as an argument to malloc
to allocate space in the table_allocate(int)
function. I was thinking just
In addition to the other posters who point out that you're only allocating enough space for the pointer, not the space the data you want will occupy, I strongly urge you to do things like this:
count_table* cTable = malloc(sizeof(*cTable));
This will help you in case the type of cTable
ever changes, you won't have to adjust two parts to that line, just the type.