source:
CIVL/mods/dev.civl.com/examples/library/stdlib/malloc2.c@
bc0fbae
| Last change on this file since bc0fbae was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 222 bytes | |
| Line | |
|---|---|
| 1 | #include<stdio.h> |
| 2 | #include<stdlib.h> |
| 3 | |
| 4 | int sum=0; |
| 5 | char* c; |
| 6 | |
| 7 | int main(){ |
| 8 | if(!c) |
| 9 | sum=1; |
| 10 | printf("%d\n", sum); |
| 11 | c=malloc(sizeof(char)); |
| 12 | if(!(c[0]=='a')) |
| 13 | sum=2; |
| 14 | printf("%d\n", sum); |
| 15 | free(c); |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
