source: CIVL/examples/languageFeatures/structArray.cvl@ f24290c

1.23 2.0 main test-branch
Last change on this file since f24290c was 4eccc907, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Added new struct examples.

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

  • Property mode set to 100644
File size: 260 bytes
Line 
1#include <civlc.h>
2
3typedef struct foo {
4 int* a;
5} foo;
6
7void main() {
8 foo bar[2];
9 int baz[3];
10
11 for (int i = 0; i < 3; i++) {
12 baz[i] = i;
13 }
14
15 bar[0].a = baz;
16 bar[1].a = &baz[1];
17
18 $assert bar[0].a[0] == 0;
19 $assert bar[1].a[0] == 1;
20}
Note: See TracBrowser for help on using the repository browser.