db_tutorial icon indicating copy to clipboard operation
db_tutorial copied to clipboard

Part 3: Too few arguments for calloc

Open nayaabkhan opened this issue 6 years ago • 0 comments

Looks like a second argument is required for calloc. In the tutorial, we have:

Table* table = calloc(sizeof(Table));

which results in a compilation error:

main.c:96:38: error: too few arguments to function call, expected 2, have 1
  Table* table = calloc(sizeof(Table));
                 ~~~~~~              ^

I think it should be changed to:

Table* table = calloc(sizeof(Table), TABLE_MAX_PAGES * PAGE_SIZE);

nayaabkhan avatar Apr 17 '19 03:04 nayaabkhan