Quick actions

cmd+k|ctrl+k

Navigation

Languages

End of struct Variable array

Snippet info

Language

Cpp

Visibility

public

Author

evine

Created

2016-04-23T03:35:14Z

Updated

2016-04-26T11:06:39Z

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

typedef int64_t s64;

struct array{
    s64 Count;
    s64 E[0];
};

struct array2{
    s64 Count;
    s64 E[0];
    s64 B[0];
};

#define EOSArray(Type, TypeArray, Name, Count)                          \
Type *Name = (Type *)alloca((Count + sizeof(Type)) * sizeof(TypeArray))
#define ArrayInit(Name, CountNum)       \
EOSArray(array, s64, Name, CountNum);   \
Name->Count = CountNum

int main()
{
    ArrayInit(hhh, 300);
    
    hhh->E[hhh->Count -1] = 8430;
    printf("%li\n", hhh->E[hhh->Count -1] );
    printf("%li\n", hhh->Count );
    
    return 0;
}
INFO