Re: How do I convert an int to binary form?



CBFalconer wrote:

pete wrote:
CBFalconer wrote:
CBFalconer wrote:
pete wrote:

... snip ...

The first time that our friend CBFalconer
noticed my (n-- != 0) stepping through an array,
as I recall, he really didn't like it.
I can't recall any words from that thread to google on though.

It took him a while to get used to it.

I don't recall that. I would be more likely to omit the "!= 0"
portion though. If n was a pointer I still object.

... snip ...

By the time that the "Implementing my own memcpy" thread
came up, CBFalconer had come around.

http://groups.google.com/group/comp.lang.c/msg/758f034e126b05cb

I'm offline, so can't use that to refresh any memories. I never
"come around". I may occasionally expand my horizons. Extreme
crusty dogmatism is the watchword here.

I looked up your reference during an online interim. It was
actually "n-- >= 0" with n an unsigned integer, leading to an
infinite loop. I certainly never even approached "coming around".

No. The above URL is one where you advocate (n--)
in response to Richard Harter blowing it with (--n >= 0).

This is an older URL of your having seen
while (nmemb-- != 0)
and not understanding it:
http://groups.google.com/group/comp.lang.c/msg/927d192c5f9d9e90

Are you trolling? The following is pasted from that reference:

-------------------- start ------------------
pete wrote:

... snip ...

void free_ptrs(char **s, size_t nmemb)
{
while (nmemb-- != 0) {
free(s[nmemb]);
}
}

A slight reorganization adds a world of safety, and makes it do the
right thing when nmemb is zero.

void free_ptrs(char **s, size_t nmemb)
{
while (nmemb) free(s[--nmemb]);
}
----------------- end paste -----------------

In future kindly post quotations rather than such (awkward to get
at for me) references. I stand by everything I said back then.

No you don't. You took it back.

http://groups.google.com/group/comp.lang.c/msg/76918442af5e6884

If
you disagree go ahead and quote and argue out in the open.

"Apologies. The original does work correctly. I was thinking
(faultily) that it would do the unsigned wrap around thing and run
indefinitely for an input value of zero, while trying to access
non-existing array members."

--
pete
.



Relevant Pages

  • Re: How do I convert an int to binary form?
    ... snip ... ... The first time that our friend CBFalconer ... I can't recall any words from that thread to google on though. ...
    (comp.lang.c)
  • Re: C rulez
    ... pete wrote: ... snip ... ... I have to give Kibo credit for this one. ... I couldn't tell if CBFalconer was being serious. ...
    (comp.lang.c)
  • Re: casting and arithmetic
    ... pete wrote: ... snip ... ... Changing 9 to 9.0 would clean ... Chuck F (cbfalconer at maineline dot net) ...
    (comp.lang.c)
  • Re: How do I convert an int to binary form?
    ... CBFalconer wrote: ... snip ... ... The first time that our friend CBFalconer ... I can't recall any words from that thread to google on though. ...
    (comp.lang.c)
  • Re: About multidimensional array
    ... required quoting all those 140 lines. ... snip - its really quite easy. ... Chuck F (cbfalconer at maineline dot net) ...
    (comp.lang.c)

Loading