Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Problem with function pointers and structures

Reply
Thread Tools

Re: Problem with function pointers and structures

 
 
jameskuyper
Guest
Posts: n/a
 
      07-08-2009
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%.
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      07-09-2009
Simon Connah wrote:
> On 2009-07-08 19:23:40 +0100, jameskuyper <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
 
 
 
jameskuyper
Guest
Posts: n/a
 
      07-09-2009
Simon Connah wrote:
> On 2009-07-09 15:47:49 +0100, Eric Sosman <(E-Mail Removed)> said:
>
> > Simon Connah wrote:
> >> On 2009-07-09 12:54:42 +0100, Eric Sosman <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointers, pointers, pointers... cerr C Programming 12 04-07-2011 11:17 PM
Re: Problem with function pointers and structures Eric Sosman C Programming 3 07-04-2009 05:35 PM
Re: Problem with function pointers and structures Jens Thoms Toerring C Programming 7 07-04-2009 01:02 PM
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM
Type Casting IPv4 and IPv6 structures to Generic Structures tweak C Programming 14 06-11-2004 02:43 PM



Advertisments