Re: Problem with function pointers and structures

Discussion in 'C Programming' started by jameskuyper, Jul 8, 2009.

  1. jameskuyper

    jameskuyper Guest

    Simon Connah wrote:
    ....
    > plus the error in this instance wasn't really the point at hand. I knew
    > I had done something wrong and knew what the problem was I just didn't
    > know how to fix it so I gave the relevant code and hoped that someone


    One of the biggest mistakes many people make when asking for help
    with a program is assuming that they know which parts of the code are
    relevant. If you don't understand a problem well enough to know what
    the solution is, there's a pretty good chance that you have
    incorrectly identified which parts of the code are relevant to solving
    it. Based upon my experiences with this newsgroup, I'd estimate that
    chance as being > 80%.
     
    jameskuyper, Jul 8, 2009
    #1
    1. Advertising

  2. jameskuyper

    Eric Sosman Guest

    Simon Connah wrote:
    > On 2009-07-08 19:23:40 +0100, jameskuyper <> said:
    >
    >> Simon Connah wrote:
    >> ...
    >>> plus the error in this instance wasn't really the point at hand. I knew
    >>> I had done something wrong and knew what the problem was I just didn't
    >>> know how to fix it so I gave the relevant code and hoped that someone

    >>
    >> One of the biggest mistakes many people make when asking for help
    >> with a program is assuming that they know which parts of the code are
    >> relevant. If you don't understand a problem well enough to know what
    >> the solution is, there's a pretty good chance that you have
    >> incorrectly identified which parts of the code are relevant to solving
    >> it. Based upon my experiences with this newsgroup, I'd estimate that
    >> chance as being > 80%.

    >
    > While your point is most likely true, in this instance my assumption
    > about where the error was, was indeed correct.
    >
    > It was clearly a syntax issue with the way I was dealing with function
    > pointers in multiple structures and a small gap in my knowledge which
    > has now been plugged.


    Your error had nothing to do with syntax. There's still
    a little seepage through your plug.

    --
    Eric Sosman
    lid
     
    Eric Sosman, Jul 9, 2009
    #2
    1. Advertising

  3. jameskuyper

    jameskuyper Guest

    Simon Connah wrote:
    > On 2009-07-09 15:47:49 +0100, Eric Sosman <> said:
    >
    > > Simon Connah wrote:
    > >> On 2009-07-09 12:54:42 +0100, Eric Sosman <> said:
    > >>
    > >>> Simon Connah wrote:

    .....
    > >>>> It was clearly a syntax issue with the way I was dealing with function
    > >>>> pointers in multiple structures and a small gap in my knowledge which
    > >>>> has now been plugged.
    > >>>
    > >>> Your error had nothing to do with syntax. There's still
    > >>> a little seepage through your plug.
    > >>
    > >> Care to enlighten me then?

    > >
    > > Ponder this syntactically correct but semantically incorrect
    > > C program:
    > >
    > > int main(void) {
    > > char *ptr = main;
    > > return 0;
    > > }

    >
    > You've lost me, I could make a guess but it wouldn't really help as it
    > would be just that.
    >
    > I guess I have missed something important in this discussion, although
    > I did base my code on previous examples found with Google which were
    > posted on this newsgroup.


    What he's saying, in an excessively obscure fashion, is that the
    problem with your code wasn't syntactic, but semantic. The syntax of
    your code was fine, but your initializers had the wrong type, which is
    semantic issue, not a syntactic one.
     
    jameskuyper, Jul 9, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tweak
    Replies:
    14
    Views:
    2,817
    Eric Sosman
    Jun 11, 2004
  2. Alfonso Morra
    Replies:
    11
    Views:
    752
    Emmanuel Delahaye
    Sep 24, 2005
  3. Jens Thoms Toerring

    Re: Problem with function pointers and structures

    Jens Thoms Toerring, Jul 2, 2009, in forum: C Programming
    Replies:
    7
    Views:
    355
    Richard Bos
    Jul 4, 2009
  4. Eric Sosman

    Re: Problem with function pointers and structures

    Eric Sosman, Jul 2, 2009, in forum: C Programming
    Replies:
    3
    Views:
    291
    Eric Sosman
    Jul 4, 2009
  5. cerr

    pointers, pointers, pointers...

    cerr, Apr 7, 2011, in forum: C Programming
    Replies:
    12
    Views:
    729
Loading...

Share This Page