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