main
|
Last change
on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
405 bytes
|
| Line | |
|---|
| 1 | #include<mem.cvh>
|
|---|
| 2 | #include<stdlib.h>
|
|---|
| 3 | #include<pointer.cvh>
|
|---|
| 4 |
|
|---|
| 5 | struct T {
|
|---|
| 6 | int (*x)[100];
|
|---|
| 7 | } ** a;
|
|---|
| 8 |
|
|---|
| 9 | int main() {
|
|---|
| 10 | a = (struct T **)malloc(sizeof(struct T*));
|
|---|
| 11 | *a = (struct T*)malloc(sizeof(struct T));
|
|---|
| 12 | (*a)->x = (int (*)[100])malloc(sizeof(int[100]) * 10);
|
|---|
| 13 |
|
|---|
| 14 | $mem m = (*a)->x;
|
|---|
| 15 |
|
|---|
| 16 | m = &(*a)->x[0][0 .. 10];
|
|---|
| 17 | m = *a;
|
|---|
| 18 | m = &(*a)->x;
|
|---|
| 19 | $assert($equals(&m, &m));
|
|---|
| 20 | free((*a)->x);
|
|---|
| 21 | free(*a);
|
|---|
| 22 | free(a);
|
|---|
| 23 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.