diff Resources/PostgreSQL/c_flexmember.c @ 0:7cea966b6829

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Jul 2018 08:16:29 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/PostgreSQL/c_flexmember.c	Wed Jul 04 08:16:29 2018 +0200
@@ -0,0 +1,13 @@
+#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;
+}