source:
CIVL/mods/dev.civl.com/examples/library/civlc/equals.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 322 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.cvh> |
| 2 | #include<pointer.cvh> |
| 3 | |
| 4 | $scope root = $here; |
| 5 | void main(){ |
| 6 | int* data; |
| 7 | _Bool result; |
| 8 | int a = 1; |
| 9 | |
| 10 | data = (int*) $malloc(root, sizeof(int)*2); |
| 11 | *data = 1; |
| 12 | *(data + 1) = 2; |
| 13 | result = $equals(data, data+1); |
| 14 | $assert(!result); |
| 15 | result = $equals(data, &a); |
| 16 | $assert(result); |
| 17 | $free(data); |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
