array refs

jsdy at SEISMO.ARPA jsdy at SEISMO.ARPA
Tue Jan 29 21:24:08 AEST 1985


> 	struct weird {
> 		int	count;
> 		...
> 		...
> 		char	string[1];
> 	};
> 
> 	w = malloc(sizeof(struct weird) + strlen(source);
> 	w->count = strlen(strcpy(w->string,source));

While I know that this is sometimes necessary when dealing with external
communications devices (e.g.), I've never really been happy about being
forced to use this device.  It seems, somehow, to be betraying the old
and good principle of "saying what you  m e a n ".

Joe Yao		hadron!jsdy at seismo.{ARPA,UUCP}



More information about the Comp.lang.c mailing list