This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tfind


Thanks for your reply Carlos. That fixed it. What is the rational behind this as it seems pointers are the only thing you can add to the tree anyway.

Sorry if this is the wrong list but,
"public discussion about glibc development. Questions or queries about core parts of glibc (not bugs) are appropriately discussed here."
This from the libc resources page is a little ambiguous, considering there seems to be no 'libc-user' list.


Regards,
Andrew Ward.

Carlos O'Donell wrote:
Andrew Ward wrote:
Could someone tell me why the following program does not print anything out. I am using gcc 4.1.3 and libc 2.6.1 on Kubuntu 7.1

The libc-alpha mailing list is for the discussion and development of the C library. Please do not post programming questions here.


puts(((A *)found)->name);

This is incorrect. The standard says it returns a pointer to the object. Your object is a pointer to A, so it returns a pointer to a pointer to A. The correct code is "puts((*(A **)found)->name);"


Good luck.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]