source: CIVL/examples/languageFeatures/structStruct.cvl@ 90dd7d7

1.23 2.0 main test-branch
Last change on this file since 90dd7d7 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: 238 bytes
Line 
1#include <civlc.h>
2
3typedef struct foo {
4 struct {
5 int* a;
6 double b;
7 } bar;
8} foo;
9
10void main() {
11 foo s;
12 int a[4];
13
14 a[2] = 3;
15 s.bar.b = 5.6;
16 s.bar.a = &a[1];
17 $assert s.bar.b == 5.6;
18 $assert s.bar.a[1] == 3;
19}
Note: See TracBrowser for help on using the repository browser.