Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!netnews.upenn.edu!msuinfo!convex.cl.msu.edu!jap From: jap@convex.cl.msu.edu (Joe Porkka) Newsgroups: comp.lang.c Subject: Re: `open ended' struct declarations (was Re: question on opendir, readdir, etc.) Message-ID: <1990Dec5.035944.29719@msuinfo.cl.msu.edu> Date: 5 Dec 90 03:59:44 GMT References: <4767@rossignol.Princeton.EDU> <14611@smoke.brl.mil> <4776@rossignol.Princeton.EDU> <14616@smoke.brl.mil> <988@mwtech.UUCP> Sender: news@msuinfo.cl.msu.edu Organization: Michigan State University Lines: 26 martin@mwtech.UUCP (Martin Weitzel) writes: >In article <14616@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >>In article <4776@rossignol.Princeton.EDU> tr@samadams.princeton.edu (Tom Reingold) writes: >>>How can it work? And why was this kludge put there? >> >>What do you mean, how can it work? If you look at the sources you >But this *is* confusing to many who are accustomed to use a given >(Somehow they seem to trust that some "magic" will get it right - but >*if* this works, it is by accident not by magic). Not so much magic since they wrote the compiler..... Pehaps it should be viewed as a defiency in the C language. If we can functions foo(arg1, arg2, ...) why can't we have structs struct my_struct { struct somedata sd; int length; char moredata[...]; /* Even better moredata[length] */ } then of course more syntax is needed to actually declare objects of type my_struct which includes the exact size. Brought to you by Super Global Mega Corp .com