Dynamically malloc()-able pointers in a struct?

J. Anderson phaedra at blake.acs.washington.edu
Sat Dec 24 18:37:05 AEST 1988


	I have a small C syntax problem.  Given I have a structure of
with the following nature:

struct xyzzy {
	int plugh;
	long black_rod;
	char *foobar;	/* This wants to be a pointer to a variable-length
			 * array
			 */
}

	I have tried various means of doing a malloc which _should_ (I
think?) assign a memory value to foobar, but to no avail.  K&&R
doesn't have a lot to say on this subject, nor does volume 5 of the
Unix Programmer's Reference manual.  Is there a way to accomplish what
I wish to do, or have I found a minor limitation in C?

-- 
There are two major products that come out of Berkeley: LSD and UNIX.  We don't
believe this to be a coincidence. ||  phaedra at blake.acs.washington.edu



More information about the Comp.lang.c mailing list