view Resources/PostgreSQL/c_flexmember.c @ 65:aa2e27f77cc8

todo
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2018 17:11:33 +0100
parents 7cea966b6829
children
line wrap: on
line source

#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
struct s { int n; double d[]; };

int main ()
{
  int m = getchar ();
  struct s *p = malloc (offsetof (struct s, d)
                        + m * sizeof (double));
  p->d[0] = 0.0;
  return p->d != (double *) NULL;
}