wrote:
> On May 4, 7:51 am, Barry Schwarz <schwa...@dqel.com> wrote:
>> On Sat, 3 May 2008 09:33:17 -0700 (PDT), vipps...@gmail.com wrote:
>> >You most likely want something like this:
>> > return calloc(0, sizeof book);
>>
>> book is a type. The parentheses are required. Other than the cast
>> and parentheses, your code is identical to the OP's. Surely not your
>> intent.
> Yes you are right, thanks for pointing that out.
> return calloc(1, sizeof bp2);
Still wrong, bp2 is a pointer. You probably meant *bp2. However, that then
spoils the whole relation because it isn't used to initialise bp2. No, in
the elided original source, bp2 can well be removed completely, so using
sizeof (book) should work.
> `book' is confusing as a type. Maybe book_t or Book. Regardless, my
> mistake.
I beg to differ. I also don't need int_t or Integer. YMMV.
Uli