Re: How to pass various structures to function?



Richard Heathfield wrote, On 03/05/07 05:33:
Fred said:

On Thu, 03 May 2007 03:11:04 +0000, Dave Vandervies wrote:
What are you really trying to do?

I'm having trouble coming up with a case where the Right Answer is
something other than "write a different function for each struct",
possibly in the degenerate case of "use a single struct for all of
the options".
I'm trying to search for data in a structure, and want to have 1
function that I can pass multiple structures to.

How will the function know what kind of structure you're passing it? It will need this information, in order to know how to conduct the search.

Unless the key to be searched on is a common initial sequence to all the structure types of interest.

Without knowing more we can't say what the best solution is, that much is certain.
--
Flash Gordon
.



Relevant Pages

  • Re: Violin puzzle
    ... Richard Heathfield wrote: ... the trouble of constructing unsolvable ... No clue. ... Western Australia ...
    (rec.puzzles)
  • Re: First IFR x-c
    ... three-eight-hotel wrote: ... would have known when you were in trouble? ... Concerned, yes but not fixated on the problem to the detriment of "Aviate, Navigate, Communicate". ... big a deal, but how did you feel, being at Santa Rosa, knowing you hit ice on the way in, and knowing you were going to potentially get back in it, on the way home? ...
    (rec.aviation.student)
  • Re: Whats a troll?
    ... is some idiot "trolling for trouble" or some such thing? ... embarrassed for not knowing this having been a software developer for some ...
    (rec.music.makers.guitar.jazz)
  • Re: Whats a troll?
    ... "troll" is some idiot "trolling for trouble" or some such thing? ... I guess I should be embarrassed for not knowing this having been a software developer for some 20 years now but I live in the business world, not the web-world. ...
    (rec.music.makers.guitar.jazz)
  • Re: Whats a troll?
    ... is some idiot "trolling for trouble" or some such thing? ... embarrassed for not knowing this having been a software developer for ...
    (rec.music.makers.guitar.jazz)