main
test-branch
|
Last change
on this file since 367a390 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:
449 bytes
|
| Line | |
|---|
| 1 | #include <pointer.cvh>
|
|---|
| 2 | #include <stdlib.h>
|
|---|
| 3 |
|
|---|
| 4 | typedef struct INT_DOUBLE {
|
|---|
| 5 | int head;
|
|---|
| 6 | double tail;
|
|---|
| 7 | }INT_DOUBLE;
|
|---|
| 8 |
|
|---|
| 9 | int main() {
|
|---|
| 10 | INT_DOUBLE * array;
|
|---|
| 11 |
|
|---|
| 12 | array = (INT_DOUBLE*)malloc(2 * sizeof(INT_DOUBLE));
|
|---|
| 13 | array[0].head = 1;
|
|---|
| 14 | array[0].tail = 2.3;
|
|---|
| 15 | array[1].head = 1;
|
|---|
| 16 | array[1].tail = 2.3;
|
|---|
| 17 | $assert_equals(&array, &array[0], "Pointer to an array and pointer to the first element of an array are different.\n");
|
|---|
| 18 | free(array);
|
|---|
| 19 | return 0;
|
|---|
| 20 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.