source:
CIVL/examples/library/string/memset.cvl@
1e2dd34
| Last change on this file since 1e2dd34 was 790a7da, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 201 bytes | |
| Line | |
|---|---|
| 1 | #include<string.h> |
| 2 | #include<stdio.h> |
| 3 | |
| 4 | int main(){ |
| 5 | char a[5]; |
| 6 | |
| 7 | memset(a, 0, 3); |
| 8 | for(int i=0; i<5; i++) printf("a[%d] = %c ", i, a[i]); |
| 9 | $assert ($forall {int k | 0<=k && k<=2 } a[k] == '\0'); |
| 10 | } |
Note:
See TracBrowser
for help on using the repository browser.
