TechFaq360 said:
> Hi ,
> Now you can post your Coding problems on techfaq360.
In your code for detecting circularity in a linked list, you fail to
initialise pointer2. If there is a circularity, your loop fails to
terminate. You need to learn how to indent your code, too.
Your code example in your "What is the difference between declaration and
definition?" section contains two syntax errors.
Your question, "What is the difference between realloc() and free()?" is a
strange one. You might as well ask "what is the difference between input
and output". Anyway, your answer fails to mention that free() can legally
be passed pointers returned by calloc and realloc, as well as malloc.
Your explanation fails to mention that realloc may have to move the data
to
a new location, since it may not be possible to resize the block in place.
You fail to mention that realloc() does at least have /one/ similarity to
free(), and you wrongly claim that a null pointer input will result in no
action taking place.
Your question, "how do you find out if a linked-list has an end?", is just
another way of phrasing your earlier question about detecting circularity.
I found all these mistakes in just a few minutes.
I cannot recommend your site to anyone who is interested in getting stuff
right. To anyone else out there, well hey, what the heck.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www.
+rjh@[EMAIL PROTECTED]
users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


|