Re: Array of size zero!

vashwath_at_rediffmail.com
Date: 12/31/04


Date: 31 Dec 2004 03:58:03 -0800


>
> It was a pre-C99 standard trial to have a flexible member array.
> The struct could be allocated this way :
> someStruct *s = malloc(sizeof (someStruct) + 42);
> So, with a single malloc, you allocated the struct and the array
objects
> simultaneously.
> In C99 a flexible array member should be declared :
> struct someStruct {
> int i;
> char array[];
> };
>
> --
> Richard

Does it works for all types(including structures) or it works only for
array of char's?



Relevant Pages

  • Re: Passing an array of structuresfrom a pointer?
    ... to only declare structs in headers and then define the ... the struct should be declared ... what if you have a simple array like this: ... In the header we would declare? ...
    (microsoft.public.vc.language)
  • Re: Passing an array of structuresfrom a pointer?
    ... I've tried an attempt to do that, and I tried to "clean" the header and main ..c file. ... int LIST_NUMBER; ... typedef struct ddListBox{ ... DDLB_COLL1array! ...
    (microsoft.public.vc.language)
  • Re: Marshalling Question: Array of Complex Structs?
    ... I've used no managed types within the struct. ... the following is the code used to call the DLL function. ... C style arrays don't have any information about the length of the array, ... byte buffers to fill with character data while the marshalling code ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: LONG: Variable internals and copy-on-write
    ... mxArray structure than ... struct mxArray_tag { ... int vartype; ... The header of a cell array looks identical to the ...
    (comp.soft-sys.matlab)
  • Re: Passing an array of structuresfrom a pointer?
    ... I just tried to access data from the DDLB_COLL1 array and got an error! ... int LIST_NUMBER; ... typedef struct ddListBox{ ... to only declare structs in headers and then define the ...
    (microsoft.public.vc.language)