Re: Help with understanding this please



Richard<rgrdev@xxxxxxxxx> writes:
Keith Thompson <kst-u@xxxxxxx> writes:
Richard<rgrdev@xxxxxxxxx> writes:
lawrence.jones@xxxxxxxxxxx writes:
Richard <rgrdev@xxxxxxxxx> wrote [re. casting the return value of malloc]:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
Why on earth would I do that? What good could it possibly do?

Yeah because C++ is wrong and so was pre Ansi C.

C++ isn't wrong, it's different (C++ programs should use new rather than
malloc). Pre-ANSI C *was* wrong, that's why ANSI changed it.

My point seems to have eluded you. And that is it is NOT obvious. And
Heathfield's reply was less than useless.

Let me draw your attention to the original poster's response to
RH's "less than useless" reply:

Thanks as always...and thanks for the humor or humour...which I know
is lost on some, but is immensely appreciated by myself.

I'm not sure if you are trying to be amusing or typically pedantic and
elusive.

Neither.

If you think

Why on earth would I do that? What good could it possibly do?

is a good answer to a newbies question then you need to take a break.

I don't think it would have been a good answer by itself. It was, in
fact, a preamble to a longer answer (which you naturally snipped)
which explained why there is no good reason to cast the result of
malloc(). Since the person asking the question found the answer *as a
whole* useful, your opinion that it's "less than useless" would seem
to be nothing more than your usual trolling.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • Re: Help with understanding this please
    ... malloc). ... Pre-ANSI C *was* wrong, ... Heathfield's reply was less than useless. ...
    (comp.lang.c)
  • Re: I want unsigned char * string literals
    ... Michael B Allen writes: ... I just said it was useless because it didn't have ... malloc is "useless" because it doesn't have a context object? ... hundreds of millions of lines of code that make use of malloc. ...
    (comp.lang.c)