ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: [ethereal-dev] Complex initializers

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard Sharpe <sharpe@xxxxxxxxxx>
Date: Fri, 10 Dec 1999 03:15:09 +1000
Hi,

I am seeking to do the following:

struct something {

  char *n1;
  char *n2;
  char *list[];
};

struct something st[] = {
  { "a1", "a2", {"a3", "a4", "a5", NULL}};

with lots of initializers like the above, where the list element can have
any number of things in it.

However, gcc won't let me do it.  Since I want to initialize lots of
structure like that, is there any way I can do it?


Regards
-------
Richard Sharpe, sharpe@xxxxxxxxxx, Master Linux Administrator :-),
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Co-author, SAMS Teach Yourself Samba in 24 Hours
Author: First Australian 5-day, intensive, hands-on Linux SysAdmin course