Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #27276 > unrolled thread

callback function

Started by"Bill Cunningham" <billcun@suddenlink.net>
First post2012-10-17 17:16 -0400
Last post2012-11-26 23:03 -0800
Articles 12 on this page of 72 — 17 participants

Back to article view | Back to comp.lang.c


Contents

  callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-17 17:16 -0400
    Re: callback function John Gordon <gordon@panix.com> - 2012-10-17 21:36 +0000
      Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-17 17:44 -0400
        Re: callback function John Gordon <gordon@panix.com> - 2012-10-17 21:51 +0000
          Re: callback function Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-18 00:11 +0100
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:37 -0400
            Re: callback function Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-19 01:16 +0100
            Re: callback function Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-10-20 06:48 -0700
      Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-18 10:45 +1300
        Re: callback function pete <pfiland@mindspring.com> - 2012-10-19 14:49 -0400
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 16:59 -0400
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 17:04 -0400
            Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-19 14:14 -0700
              Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 17:31 -0400
                Re: callback function Keith Thompson <kst-u@mib.org> - 2012-10-19 14:54 -0700
                  Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 18:42 -0400
      Re: callback function James Kuyper <jameskuyper@verizon.net> - 2012-10-17 17:47 -0400
      Re: callback function tom st denis <tom@iahu.ca> - 2012-10-19 04:44 -0700
        Re: callback function James Kuyper <jameskuyper@verizon.net> - 2012-10-19 08:24 -0400
    Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-17 14:39 -0700
      Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-17 17:50 -0400
        Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-18 11:00 +1300
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:20 -0400
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:24 -0400
            Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-18 22:30 -0700
            Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-20 11:58 +1300
              Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 19:27 -0400
                Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 19:43 -0400
                  Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-19 21:09 -0700
            Re: callback function Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-10-20 06:53 -0700
        Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-17 19:25 -0400
          Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-18 13:34 +1300
            Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-17 20:41 -0400
              Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-18 14:37 +1300
                Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:17 -0400
                  Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-20 11:54 +1300
                Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:54 -0400
                  Re: callback function Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-19 01:23 +0100
                    Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 20:32 -0400
                      Re: callback function Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-19 02:43 +0100
                        Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 16:56 -0400
                          Re: callback function Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-10-19 22:10 +0100
                      Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-18 22:30 -0700
                        Re: callback function Kenneth Brody <kenbrody@spamcop.net> - 2012-10-19 12:37 -0400
                          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 16:52 -0400
      Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-19 18:44 -0400
        Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-19 21:09 -0700
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-20 15:01 -0400
            Re: callback function Keith Thompson <kst-u@mib.org> - 2012-10-20 12:47 -0700
            Re: callback function Les Cargill <lcargill99@comcast.com> - 2012-10-20 14:51 -0500
            Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-20 14:39 -0700
              Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-20 19:06 -0400
                Re: callback function Barry Schwarz <schwarzb@dqel.com> - 2012-10-20 22:22 -0700
                  Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-21 14:35 -0400
                  Re: callback function Kenneth Brody <kenbrody@spamcop.net> - 2012-10-22 10:58 -0400
                Re: callback function Bill Cunningham <billcun@suddenlink.net> - 2012-10-24 17:28 -0700
            Re: callback function Ian Collins <ian-news@hotmail.com> - 2012-10-21 11:32 +1300
              Re: callback function Keith Thompson <kst-u@mib.org> - 2012-10-20 15:51 -0700
        Re: callback function Robert Miles <milesrf@Usenet-News.net> - 2012-11-25 22:39 -0600
    Re: callback function Keith Thompson <kst-u@mib.org> - 2012-10-17 17:51 -0700
      Re: callback function Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-10-18 20:34 +0300
      Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:15 -0400
        Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:27 -0400
        Re: callback function Keith Thompson <kst-u@mib.org> - 2012-10-18 15:47 -0700
          Re: callback function "Bill Cunningham" <billcun@suddenlink.net> - 2012-10-18 18:52 -0400
        Re: callback function blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2012-10-25 10:01 +0000
          Re: callback function Kenneth Brody <kenbrody@spamcop.net> - 2012-10-25 12:44 -0400
            Re: callback function blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2012-10-26 12:48 +0000
    Re: callback function Robert Miles <milesrf@Usenet-News.net> - 2012-11-25 22:13 -0600
      Re: callback function Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-26 03:42 -0800
      Re: callback function James Kuyper <jameskuyper@verizon.net> - 2012-11-26 06:59 -0500
      Re: callback function Keith Thompson <kst-u@mib.org> - 2012-11-26 23:03 -0800

Page 4 of 4 — ← Prev page 1 2 3 [4]


#27314

FromPhil Carmody <thefatphil_demunged@yahoo.co.uk>
Date2012-10-18 20:34 +0300
Message-ID<874nlr3cqt.fsf@bazspaz.fatphil.org>
In reply to#27294
Keith Thompson <kst-u@mib.org> writes:
> "Bill Cunningham" <billcun@suddenlink.net> writes:
> >     I have these 3 functions and before I compile I am going to ask about 
> > them.
> [...]
> 
> You're posting code that you haven't even tried to compile?
> 
> Please don't waste our time.

Why didn't Bill hit everyone's killfiles half a decade ago?
Your advice is heading straight down /dev/null every time you
address his wibblings.

Phil
-- 
Regarding TSA regulations:
How are four small bottles of liquid different from one large bottle?
Because four bottles can hold the components of a binary liquid explosive,
whereas one big bottle can't. -- camperdave responding to MacAndrew on /.

[toc] | [prev] | [next] | [standalone]


#27317

From"Bill Cunningham" <billcun@suddenlink.net>
Date2012-10-18 18:15 -0400
Message-ID<k5pv1a$t1v$1@speranza.aioe.org>
In reply to#27294
Keith Thompson wrote:

> You're posting code that you haven't even tried to compile?
>
> Please don't waste our time.

Why do some people post untested code? I didn't know it was against the 
rules. I've seen it alot. It's tested now and works perfectly.

Bill

[toc] | [prev] | [next] | [standalone]


#27321

From"Bill Cunningham" <billcun@suddenlink.net>
Date2012-10-18 18:27 -0400
Message-ID<k5pvoa$ulv$1@speranza.aioe.org>
In reply to#27317
Bill Cunningham wrote:
> Keith Thompson wrote:
>
>> You're posting code that you haven't even tried to compile?
>>
>> Please don't waste our time.
>
> Why do some people post untested code? I didn't know it was against
> the rules. I've seen it alot. It's tested now and works perfectly.

    Also untested code illustrated my point and answered my question 
perfectly. I'm just in the *out* group.

Bill

[toc] | [prev] | [next] | [standalone]


#27324

FromKeith Thompson <kst-u@mib.org>
Date2012-10-18 15:47 -0700
Message-ID<lnmwzjieic.fsf@nuthaus.mib.org>
In reply to#27317
"Bill Cunningham" <billcun@suddenlink.net> writes:
> Keith Thompson wrote:
>
>> You're posting code that you haven't even tried to compile?
>>
>> Please don't waste our time.
>
> Why do some people post untested code? I didn't know it was against the 
> rules. I've seen it alot. It's tested now and works perfectly.

Your code wasn't merely untested; you hadn't even compiled it.
It wasn't a violation of some specific rule, it was a violation of
common sense.  You didn't bother to spend a minute or so compiling
your code before you posted it here.  The code you posted was full
of syntax errors that anyone trying to help you would have to fix
before answering your actual question.

    int comp(constvoid *a,const void *b)

Why should I spend time fixing errors like this, not relevant to the
question you're asking, that you could have fixed yourself?  How is
anyone supposed to know which errors are just typos, and which are
relevant to the problem you're trying to solve?

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

[toc] | [prev] | [next] | [standalone]


#27325

From"Bill Cunningham" <billcun@suddenlink.net>
Date2012-10-18 18:52 -0400
Message-ID<k5q17j$1t5$1@speranza.aioe.org>
In reply to#27324
Keith Thompson wrote:

> Your code wasn't merely untested; you hadn't even compiled it.
> It wasn't a violation of some specific rule, it was a violation of
> common sense.  You didn't bother to spend a minute or so compiling
> your code before you posted it here.  The code you posted was full
> of syntax errors that anyone trying to help you would have to fix
> before answering your actual question.
>
>    int comp(constvoid *a,const void *b)
>
> Why should I spend time fixing errors like this, not relevant to the
> question you're asking, that you could have fixed yourself?  How is
> anyone supposed to know which errors are just typos, and which are
> relevant to the problem you're trying to solve?

I'll be more careful.

Bill

[toc] | [prev] | [next] | [standalone]


#27671

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2012-10-25 10:01 +0000
Message-ID<aesgvlFk659U1@mid.individual.net>
In reply to#27317
In article <k5pv1a$t1v$1@speranza.aioe.org>,
Bill Cunningham <billcun@suddenlink.net> wrote:
> Keith Thompson wrote:
> 
> > You're posting code that you haven't even tried to compile?
> >
> > Please don't waste our time.
> 
> Why do some people post untested code? I didn't know it was against the 
> rules. I've seen it alot. It's tested now and works perfectly.
> 


Consider two scenarios:

Person X posts untested code and asks for help with it.  

Person Y posts untested code in response to a question or request for
help.

Can you really not perceive a difference between these two situations,
one that doesn't involve "in" and "out" groups?


Aside, not just to you:  I'm always amused by claims that code "works
perfectly".  "Works for all the tests I tried", okay, but -- oh well,
I suppose I'm just a pessimist?  It does seem like only relatively
inexperienced programmers make such claims.


-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#27677

FromKenneth Brody <kenbrody@spamcop.net>
Date2012-10-25 12:44 -0400
Message-ID<HtidnZHdJcz28RTNnZ2dnUVZ_jydnZ2d@bestweb.net>
In reply to#27671
On 10/25/2012 6:01 AM, blmblm@myrealbox.com wrote:
[...]
> Aside, not just to you:  I'm always amused by claims that code "works
> perfectly".  "Works for all the tests I tried", okay, but -- oh well,
> I suppose I'm just a pessimist?  It does seem like only relatively
> inexperienced programmers make such claims.

Well, I have no problem believing the "works for all tests I tried" claims. 
  I just don't believe that their test suite was very extensive.

"No, I never tried entering 'antidisestablishmentarianism'.  Why do you ask?"

"No, I never tried entering 12345678901234567890.  Why do you ask?"

"No, I never tried passing a negative number.  Why do you ask?"

-- 
Kenneth Brody

[toc] | [prev] | [next] | [standalone]


#27719

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2012-10-26 12:48 +0000
Message-ID<aevf55FaofhU1@mid.individual.net>
In reply to#27677
In article <HtidnZHdJcz28RTNnZ2dnUVZ_jydnZ2d@bestweb.net>,
Kenneth Brody  <kenbrody@spamcop.net> wrote:
> On 10/25/2012 6:01 AM, blmblm@myrealbox.com wrote:
> [...]
> > Aside, not just to you:  I'm always amused by claims that code "works
> > perfectly".  "Works for all the tests I tried", okay, but -- oh well,
> > I suppose I'm just a pessimist?  It does seem like only relatively
> > inexperienced programmers make such claims.
> 
> Well, I have no problem believing the "works for all tests I tried" claims. 

Except the beginners don't seem to say it that way, do they?  they say 
something works "perfectly" or "flawlessly".  Cynic that I am, I'm
inclined to agree with your comment:

>   I just don't believe that their test suite was very extensive.
>
> "No, I never tried entering 'antidisestablishmentarianism'.  Why do you ask?"
> 
> "No, I never tried entering 12345678901234567890.  Why do you ask?"
> 
> "No, I never tried passing a negative number.  Why do you ask?"
> 

Indeed.

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#28652

FromRobert Miles <milesrf@Usenet-News.net>
Date2012-11-25 22:13 -0600
Message-ID<50b2ec66$0$8622$862e30e2@ngroups.net>
In reply to#27276
On 10/17/2012 4:16 PM, Bill Cunningham wrote:
>      I have these 3 functions and before I compile I am going to ask about
> them. This is for qsort. I tried to tackle this once and couldn't get it I
> think I get it now. I don't like const's. They are a nuisance. You can't
> directly pass string literals to them you want to change. Maybe that's just
> the way C is though.

const is intended to be used for items with values known at compile
time that do not need to be changed as the program runs.  Looks like
you aren't trying to use it that way, and are therefore having
problems with anything you declare const.

[toc] | [prev] | [next] | [standalone]


#28656

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2012-11-26 03:42 -0800
Message-ID<37d19535-e56b-4f3b-ac92-f4fff3e151c9@googlegroups.com>
In reply to#28652
On Monday, November 26, 2012 4:13:27 AM UTC, Robert Miles wrote:
> On 10/17/2012 4:16 PM, Bill Cunningham wrote:
> 
> const is intended to be used for items with values known at compile 
> time that do not need to be changed as the program runs.  Looks like
> you aren't trying to use it that way, and are therefore having
> problems with anything you declare const.
>
That's one use. A more common use is to document that a function doesn't
change data.
Eg
char *stripspace(const char *str)
indicates that the function is likely to return a pointer to a stripped
string, rather than strip it in place.

[toc] | [prev] | [next] | [standalone]


#28657

FromJames Kuyper <jameskuyper@verizon.net>
Date2012-11-26 06:59 -0500
Message-ID<k8vlit$eal$1@dont-email.me>
In reply to#28652
On 11/25/2012 11:13 PM, Robert Miles wrote:
...
> const is intended to be used for items with values known at compile
> time that do not need to be changed as the program runs. ...


That would only allow it's use on objects with static storage duration.
I would change "compile time" to "initialization", and "as the program
runs" to "during their lifetime", so as to cover the use of objects with
automatic storage, where 'const' can also be valuable. As Malcolm has
already pointed out, "const T*" is also useful for pointers that you do
not intend to use to change the pointed-at object.
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#28672

FromKeith Thompson <kst-u@mib.org>
Date2012-11-26 23:03 -0800
Message-ID<lnip8rjzmu.fsf@nuthaus.mib.org>
In reply to#28652
Robert Miles <milesrf@Usenet-News.net> writes:
> On 10/17/2012 4:16 PM, Bill Cunningham wrote:
>>      I have these 3 functions and before I compile I am going to ask about
>> them. This is for qsort. I tried to tackle this once and couldn't get it I
>> think I get it now. I don't like const's. They are a nuisance. You can't
>> directly pass string literals to them you want to change. Maybe that's just
>> the way C is though.
>
> const is intended to be used for items with values known at compile
> time that do not need to be changed as the program runs.  Looks like
> you aren't trying to use it that way, and are therefore having
> problems with anything you declare const.

const doesn't mean that something's value can be determined at
compile time.  It merely means read-only.

This:

    const int r = rand();

is perfectly valid (at block scope, anyway).

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

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | comp.lang.c


csiph-web