source: CIVL/mods/dev.civl.abc/examples/c/complexStructArray.c

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 300 bytes
Line 
1#include<stdlib.h>
2#include<assert.h>
3
4int main() {
5 struct T {
6 int (*x)[10];
7 } ** a;
8
9 a = (struct T **)malloc(sizeof(struct T *));
10 a[0] = (struct T *)malloc(sizeof(struct T));
11 a[0][0].x = (int (*)[10])malloc(sizeof(int[10]));
12 a[0][0].x[0][0] = 9;
13
14 assert(a[0][0].x[0][0] == 9);
15}
Note: See TracBrowser for help on using the repository browser.