Hi Scott,
On Fri, Jan 21, 2005 at 02:31:57PM -0700, Scott wrote:
> recip_data[0].var = namectrl;
namectrl is NULL, so why would you want to do this? This is just like
writing
recip_data[0] = NULL;
I am not quite sure what you intend to do, but I guess that you want
namectrl to change when you change recip_data[0]. To accomplish this,
you could make recip_data[0] a pointer to a pointer:
char *namectrl = NULL;
char *name1 = NULL;
char *name2 = NULL;
typedef struct {
char **var; /* destination for storage of the data */
size_t len; /* max len of the data */
char *(*xlat)(); /* translation routine */
} DATUM;
DATUM recip_data[] = {
{ &namectrl, NAMECTRL_LEN, make_upper },
{ &name1, NAME1_LEN, make_upper },
{ &name2, NAME2_LEN, make_upper },
[...]
Now you can change namectrl by saying
*recip_data[0].var = "test string";
Hope this helps,
Christoph
--
``There's no dark side of the moon, really
Matter of fact, it's all dark''
--Pink Floyd
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming"
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html