array and structure initialization

knutsen at sri-unix.UUCP knutsen at sri-unix.UUCP
Sat Jun 11 06:14:29 AEST 1983


Say I have a structure foo

struct foo {
	char *f_slist[];
	int f_code;
}

	and I want to initialize one. Since

char *foo[] = {"aaa", "bbb", "ccc", ""};

	works, I tried

struct foo foobar = {{"xx", "yy", ""}, 1};

	and got "0-length row: f_slist" and "too many initializers: f_slist"
errors. Any ideas?

	Thanks...
Andrew Knutsen SRI



More information about the Comp.lang.c mailing list