Re: How to pass various structures to function?
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 03 May 2007 08:26:27 +0100
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 trying to search for data in a structure, and want to have 1
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".
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
.
- References:
- How to pass various structures to function?
- From: Fred
- Re: How to pass various structures to function?
- From: Dave Vandervies
- Re: How to pass various structures to function?
- From: Fred
- Re: How to pass various structures to function?
- From: Richard Heathfield
- How to pass various structures to function?
- Prev by Date: Re: Why segfault and no NULL match in for loop?
- Next by Date: Re: gets() is dead
- Previous by thread: Re: How to pass various structures to function?
- Next by thread: Re: How to pass various structures to function?
- Index(es):
Relevant Pages
|